I need to create a central Git repository but I'm a little confused...
I have created a bare repository (in my git server, machine 2) with:
$ mkdir test_repo
$ git --bare init
Firstly, just to check, you need to change into the directory you've created before running
git init --bare. Also, it's conventional to give bare repositories the extension
.git. So you can do
git init --bare test_repo.git
For Git versions < 1.8 you would do
mkdir test_repo.git cd test_repo.git git --bare init
To answer your later questions, bare repositories (by definition) don't have a working tree attached to them, so you can't easily add files to them as you would in a normal non-bare repository (e.g. with
git add <file> and a subsequent
You almost always update a bare repository by pushing to it (using
git push) from another repository.
Note that in this case you'll need to first allow people to push to your repository. When inside
git config receive.denyCurrentBranch ignore