Installing Git with Gitosis
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:
-
cd ~/src
-
git clone git://eagain.net/gitosis.git
-
cd gitosis
-
./setup.py install
-
useradd git
-
#end of obvious stuff
-
-
gitosis-init < /location/of/administrators/public/id_rsa.pub #this will allow you to administer gitosis remotely
-
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!
-
git clone git@stratos:gitosis-admin.git
-
cd gitosis-admin
-
vim gitosis.conf #edit groups and repositories
-
writable = bla is responsible for the repositories
-
#for example you could setup:
-
#then just do the stuff you would normally do with git:
-
#[group secret-group]
-
#writable = bla
-
#members = ktoso@homunculus ktoso@protos
-
#here's how your dir structure should look like
-
#├── gitosis.conf #repository configuration
-
#└── keydir #put all (ssh) public keys of your users in here
-
# ├── ktoso@homunculus.pub
-
# └── ktoso@protos.pub
-
#now just do what you would normally do with a git repository
-
git add .
-
git commit -m 'new repo: bla'
-
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


Post a reply