Skip to content

Instantly share code, notes, and snippets.

@aurels
Created December 20, 2009 13:49
Show Gist options
  • Save aurels/260489 to your computer and use it in GitHub Desktop.
Save aurels/260489 to your computer and use it in GitHub Desktop.
# Install gitosis on a server
Source: http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way
# On the server :
$ cd ~/src
$ git clone git://eagain.net/gitosis.git
$ cd gitosis
$ sudo apt-get install python-setuptools
$ sudo python setup.py install
$ sudo adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git
# On local machine :
$ ssh-keygen -t rsa # if needed
# Copy the local ~/.ssh/id_rsa.pub to /tmp/id_rsa.pub on the server :
scp .ssh/id_rsa.pub user@host:/tmp/id_rsa.pub
# On the server :
$ sudo -H -u git gitosis-init < /tmp/id_rsa.pub
$ sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update
# On the local machine :
git clone git@YOUR_SERVER_HOSTNAME:gitosis-admin.git
cd gitosis-admin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment