How can I setup a git repository on a local system ? (I am on a windoze box)
This is the setup I am trying to achieve: (everything is on my local machine)
I want to do all my dev in the client folder. Once I am done, I'd like to push it to the host folder.
This is what I've done: (using git bash on windows)
cd c:/
When I push stuff to origin, git spits a lot of remote errors. However, when I make my host a bare git, it pushes successfully.
I don't understand the difference between regular git and bare git. From the manual, all I understood was, bare git is used for storing deltas and when you don't want to store original files. However, I'd like to store the files in host. How can I do that ?
Git allows you to create a local repository on your machine. Only when you're actually ready to publish it to a remote is when it becomes available to the public.
Using Windows Explorer, find the local directory containing your files, right click on it and choose Git GUI Here, then Create New Repository. Enter the path of the local directory in the popup window, and click Create. This will create all the necessary files in your local directory for the local repository.
The difference between a "regular git" and a "bare git" is that a bare repository does not have a working directory. You should never push into a regular git repository, as you may run into problems that are hard to recover from. Always push into a bare repository.
If you want to have a "host" where copies of your files do appear, then set up a third repository, cloning from the host one. Whenever you want to update the host files:
git push
from your working directory to update the main repositorygit pull
from your host directory to pull from the originYou can even set up a post-commit hook on the bare repository to automatically do the second step.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With