This are my thoughts about setting up Git repository on Ubuntu Linux with Gitosis.

Basically you can base on that great post as I did, but I will add some comments base on my experience.

First of all I installed Git with command

apt-get install git

after that I installed Gitosis - the great package to manage Git repositories and user access

apt-get install gitosis

With Git is also installed git-daemon - tool that will expose your repositories to everybody. To allow cooperate them both you have to edit /etc/sv/git-daemon/run file and modify line with exec … to be like that

exec chpst -ugitdaemon git daemon --verbose --base-path=/srv/gitosis/repositories --export-all

The path /srv/gitosis/repositories is were your repositories will be stored. Option –export-all will make all your repositories accessible by anyone (in read-only mode)

The worst thing is to set up your ssh client with certificate. If you generated your keys, create file ~/.ssh/config and add such a entry

Host your.host.with.repo
         IdentityFile ~/.ssh/id_rsa

~/.ssh/id_rsa is your private key, then try to start ssh session with the host

ssh -v mylogin@your.host.with.repo

You should login without problems - if not, please check if ssh client is reading the private key from your home directory (I'm using Cygwin on my Windows box and the client was reading it from C:\Document and Settings\ folder instead from C:\cygwin\home)

Now you are ready to clone gitosis-admin repo. There is only mismatch in link above - user names in gitosis.conf file have to be related to file name with user public key, so if you add user jacek the file name with jacek's public key have to be jacek.pub.

That sit! Enjoy!!!

article/setting-up-git-repository-on-linux.txt · Last modified: 2010-03-10 17:59 by Lukasz Lenart
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki