Installing Git with Gitosis

Posted by Ktoso on 07/03/2010 – 16:22

Git is really simple and VERY powerfull. It makes svn look like an idiot – but that’s just my personal opinion ;-)

Anyways, I’m using github most of the time, but now I’d like to hava a non public repository (yet remote) for some small project. I’ve been commiting to a local git instance from the begining of this project so just pushing it into a new repo will be really simple.

I wanted to have som easy to administer localozed git to serve hit hosting for my friends etc. So this is how I did it:

On server:

# do this as root of course
  1. cd ~/src
  2. git clone git://eagain.net/gitosis.git
  3. cd gitosis
  4. ./setup.py install
  5. useradd git
  6. #end of obvious stuff
  7.  
  8. gitosis-init < /location/of/administrators/public/id_rsa.pub #this will allow you to administer gitosis remotely
  9. sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update # in case gitosis-init didn't do this already

Now we can do all the administration without being logged in into our server – just by using git!

#all of the following is done LOCALLY!
  1. git clone git@stratos:gitosis-admin.git
  2. cd gitosis-admin
  3. vim gitosis.conf #edit groups and repositories
  4. writable = bla is responsible for the repositories
  5. #for example you could setup:
  6. #then just do the stuff you would normally do with git:
  7. #[group secret-group]
  8. #writable = bla
  9. #members = ktoso@homunculus ktoso@protos
  10. #here's how your dir structure should look like
  11. #├── gitosis.conf #repository configuration
  12. #└── keydir #put all (ssh) public keys of your users in here
  13. #    ├── ktoso@homunculus.pub
  14. #    └── ktoso@protos.pub
  15. #now just do what you would normally do with a git repository
  16. git add .
  17. git commit -m 'new repo: bla'
  18. git push

You can then just pull/clone this repo:

git clone git://stratos/bla.git

Yeah, this post isn't much of an discovery - yet I wanted to show you how SIMPLE and SCALABLE a simple git repository can be. For mor information about git and gitosis see: a simple google search

Tags: , , , , , , ,

This post is under “coding, guide, java, Project13” and has no respond so far.

Post a reply