Posts Tagged: gitosis

Setting up Gitosis with Windows Server 2008


As part of our Git server configuration, we’re using Gitosis manage multiple repositories with different authorization requirements using a single SSH account.

I’m assuming you’ve read my previous post on Setting up a Git server with Windows Server 2008 and are ready to follow along as the steps assume you’ve already installed Cygwin with Git, OpenSSH and Python.

The blog post by Sandesh Singh on setting up Gitosis with Windows Vista was an amazing resource and without it, I would still be trying to get Gitosis working.

Installing Python Setuptools

  • Download the Python Setuptools egg.
  • Open a Cygwin bash prompt and navigate to the directory containing your download.
  • Execute
    sh setuptools-0.6c9-py2.5.egg
  • You should see
    Processing setuptools-0.6c9-py2.5.egg
    Copying setuptools-0.6c9-py2.5.egg to /usr/lib/python2.5/site-packages
    Adding setuptools 0.6c9 to easy-install.pth file
    Installing easy_install script to /usr/bin
    Installing easy_install-2.5 script to /usr/bin
    
    Installed /usr/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg
    Processing dependencies for setuptools==0.6c9
    Finished processing dependencies for setuptools==0.6c9
    
  • Execute
    chmod +r /usr/lib/python2.5/ -R

Installing Gitosis

  • Download or clone the Gitosis repository
  • Open a Cygwin bash prompt and navigate to the directory containing Gitosis.
  • Execute

    python setup.py install
  • Copy the public key of the user you wish to administer the Gitosis server to /tmp directory.
  • Log out of the Administrator account and login as the git account.
  • Open a Cygwin bash prompt and execute
    gitosis-init < /tmp/id_rsa.pub
  • You should see

    Initialized empty Git repository in /home/git/repositories/gitosis-admin.git/
    Reinitialized existing Git repository in /home/git/repositories/gitosis-admin.git/
    
  • Execute
    chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update

Gitosis is now setup and we're ready to clone the gitosis-admin repository to create and administer Git repositories on our server.