Skip to content

Instantly share code, notes, and snippets.

@kapkaev
Created January 31, 2012 21:03
Show Gist options
  • Save kapkaev/1712892 to your computer and use it in GitHub Desktop.
Save kapkaev/1712892 to your computer and use it in GitHub Desktop.
centOS gitosis
#step 1
yum -y install python-setuptools
#step 2
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
# or
# rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
#step 3
# if you using centOS 6.2 enable rpmforge-extras (enabled =1)
vim /etc/yum.repos.d/rpmforge.repo
yum -y install git
#step4(On your server)
git clone git://eagain.net/gitosis.git && cd gitosis
python setup.py install
#step5(On your server)
adduser git && passwd git
#step6(On your client)
ssh-keygen -t rsa
scp ~/.ssh/id_rsa.pub [email protected]:/home/git/
#step7(On your server)
su git
cd /home/git
gitosis-init < id_rsa.pub
rm id_rsa.pub
chmod 755 /home/git && chmod 700 /home/git/.ssh && chmod 644 /home/git/.ssh/authorized_keys
#step8(On your client)
git clone [email protected]:gitosis-admin.git
cd gitosis-admin
vim .gitosis.conf
[group myNewProject]
writable = myNewProject
members = foo@bar bar@foo
#step9(On your client)
git commit -a -m "Allow the machine I am on right now write access to myNewProject"
git push
cd ..
mkdir myNewProject && cd myNewProject
git init
git remote add origin [email protected]:myNewProject.git
git add .
git commit -a -m "This is my initial commit for myNewProject"
git push origin master:refs/heads/master
cd ..
rm -fr myNewProject
#And now to pull myNewProject from the server using clone..
git clone [email protected]:myNewProject
#step9(On your client)
cd gitosis-admin
mv ~/id_rsa.pub keydir/bob.pub && git add keydir/bob.pub
members = [email protected] bob
git commit -a -m "Added commit rights to Bob on myNewProject"
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment