Posts Tagged ‘git’
Git versus SVN Presentation November 24th, 2008
Last week I made a presentation about Git and compared it to Subversion. There is an obvious bias in the slides however, I tried to make a point to show the downsides of Git as well. One slide that is missing is one on security and the idea of Git storing all the commit history on each machine can be a security risk in some scenarios. Feel free to use these slides in your own presentation, but post a link back as a thank you.
Slides: git-presentation
Tags: git, scm, subversion, svn
Posted in Development | Comments (0)
Git your own server! August 11th, 2008
With the recent boom of GitHub, there are thousands migrating from old subversion and even cvs servers to git. Surprisingly however, many people would rather pay GitHub to host their site instead of doing it themselves. Well I may be on the git bandwagon, but I am definitely not on the pay-for-git one. I recently setup two git servers (for redundancy). This will be a brief tutorial on getting your own git server running on Debian Etch/Lenny/Sid (or Ubuntu).
First we need to install git. Simple enough with this command:
[code language="shell"]$ sudo apt-get install git-core git-doc git-svn git-email git-cvs[/code]
Now we want to ensure git installed correctly
[code language="shell"]$ git –version
git version 1.5.6.3[/code]
If you are running Debian Etch, you need to use the backports-etch repo to install git >= 1.5. Or compile it from source.
Alright then just follow the commands:
[sourcecode language="shell"]$ sudo apt-get install python
$ sudo apt-get install python-setuptools[/sourcecode]
Once those are installed just copy paste the following commands. We are going to use gitosis as a way to manage repositories and git access privileges.
[code language="shell"]$ git clone git://eagain.net/gitosis
$ cd gitosis
$ python setup.py install[/code]
If you receive any errors from running the setup.py script, ensure you installed all the packages above from apt-get.
[sourcecode language="shell"]$ sudo adduser \
–system \
–shell /bin/sh \
–gecos ‘git version control’ \
–group \
–disabled-password \
–home /home/git \
git[/sourcecode]
This will setup all your repositories inside of /home/git, feel free to change this to whatever location you desire. Now thats all done, we just need to get your SSH certificate setup so that you can initialize your gitosis install.
This is how it would be done on OSX (this guide for full info on generating SSH keys). From your local machine, issue this command:
[code language="shell"]$ scp ~/.ssh/id_rsa.pub yourusername@yourserver:/tmp/[/code]
Now to wrap this up quickly, go back to your server and setup the SSH key for the gitosis repo.
[code language="shell"]$ sudo -H -u git gitosis-init < /tmp/id_rsa.pub[/code]
If you get an error on initialization then you do not have git >= 1.5. For the rest of us, now we just need to edit the gitosis repo to add/delete users and git repositories! Issuing a simple git push, will propegate the change. For full information, see the gitosis README.
Tags: debian, etch, git, github, gitosis, lenny, sid, ssh, ubuntu
Posted in Development | Comments (0)


