ATTENTION:
current gitosis debian package does a chmod -R git:git /var/cache/git, if you allready have a git repository setup be c
arefully! #473574
Install
apt-get update
apt-get install gitosis
This creates a user git with /var/cache/git as $HOME (which is also the default directory for git-daemon to serve). I've changed this to the normal /home/git as i want gitosis only for non-public projects.
Initialise
% su git
$ gitosis-init </tmp/id_rsa.pub
Initialized empty Git repository in ./
Initialized empty Git repository in ./
% git clone git@localhost:gitosis-admin.git
% cd gitosis-admin
see gitosis documentation if you need further help on configuration or http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way
Problems:
- ssh git@localhost:
Mar 31 14:27:06 god sshd[27051]: User git not allowed because account is locked
If you encounter something like this then you should update your adduser packet because it is broken. #433639
Fix: change the ! in /etc/shadow in the line of your git user to *.
- gitosis config is not updated after push:
chmod 755 $(readlink ~git/repositories/gitosis-admin.git/hooks/post-update)
The post-update hook is not executable and is a link on debian (#473613), the above should temporarily fix this.