onsdag 25 januari 2012


Adapted from http://blog.agdunn.net/?p=277

pacman -S git-core setuptools
useradd --home-dir=/media/STORAGE/git --create-home --system git
su -l git

git clone git://eagain.net/gitosis.git
cd ~/gitosis
patch gitosis/ssh.py <<EOF
<     TEMPLATE=('command="gitosis-serve %(user)s",no-port-forwarding,'
>     TEMPLATE=('command=".local/bin/gitosis-serve %(user)s",no-port-forwarding,'
patch gitosis/templates/admin/hooks/post-update <<EOF
< gitosis-run-hook post-update
> ~/.local/bin/gitosis-run-hook post-update
git commit -a -m 'Adapt Gitosis for being installed with python setup.py install --user' --author 'Lars Rasmusson <Lars.Rasmusson@gmail.com>'
python2.7 setup.py install --user

[ paste your public ssh key and press CTRL-D ]

chmod u+x ~/repositories/gitosis-admin.git/hooks/post-update

Now you can clone the repository gitosis-admin.git from the server using

git clone git@servername:gitosis-admin.git

To add a user with pubkey file username.pub

cp username.pub gitosis-admin/keydir/
(cd gitosis-admin; git commit keydir -m 'added user'; git push)

To give the user access to a repository, add him to a group
(or create a new group for him), and add the repository name
to the ‘writable’ list for that group in gitosis-admin/gitosis.conf

1 kommentar:

  1. After all, having the right word on hand to express yourself properly means that you’ll find it easier to get good grades. http://d5n5zm57el.dip.jp http://zh7pg47ivw.dip.jp http://1sdfa9y5tg.dip.jp