I'm going to work on a project with a teammate, so we decided to set up a Git server. We followed this tutorial : http://git-scm.com/book/en/Git-on-the-Server-Gitosis
We created a gitrepo/
directory locally on my computer, and did a git init
inside it.
Then, we created a index.html
file, git add index.html
and git commit -m "First commit."
.
We configured the remote server with git remote add origin git@SERVER:gitrepo.git
, SERVER
being our server. The git
user seems to be ok so far, SSH keys too.
Output of git push origin master
(SERVER
replaced) :
Counting objects: 5, done.
Writing objects: 100% (3/3), 255 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@SERVER:gitrepo.git
bf6c7a0..283eb49 master -> master
Seems to be okay too, but when I do a ls /home/git/repositories/gitrepo.git/branches
, there is nothing. I should have a master
directory, with index.html
in it, right ?
Something is wrong but I can't figure out what.
As gitosis uses bare repos, the answer is "No". No branches, no files, no-thing wrong.
You can read about bare repos here: http://gitolite.com/concepts/bare.html
You can test that it indeed worked by cloning the remote repo at another location/pull from it.