I have made the switch from SVN to Git for all of my projects and I'm loving it. So I decided as part of my deployment process, I would install Git on my server and use Git to fetch the release code to the deployment folder. This is alot like I did with Subversion, using svn export to push a tagged release to the server. Installing Git was quite simple even though there is no package for CentOS 5 yet. Here is the process I used to set it up.
The following packages are dependancies for Git, so make sure they are installed.
yum install zlib-devel
yum install openssl-devel
yum install perl
yum install cpio
yum install expat-devel
yum install gettext-devel
yum install openssl-devel
yum install perl
yum install cpio
yum install expat-devel
yum install gettext-devel
Next, if you do not already have Curl installed, follow the next step to get it up and running.
wget http://curl.haxx.se/download/curl-7.18.0.tar.gz
tar xzvf curl-7.18.0.tar.gz
cd curl-7.18.0
./configure
make
make install
tar xzvf curl-7.18.0.tar.gz
cd curl-7.18.0
./configure
make
make install
Next, make sure /usr/local/lib is in your ld.so.conf, this is required for git-http-push to correctly link up to the Curl version you are installing.
vi /etc/ld.so.conf
(Insert the following)
/usr/local/lib
(Insert the following)
/usr/local/lib
Save the file, then run:
ldconfig
Now download and install Git
wget http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz
tar xzvf git-latest.tar.gz
cd git-{date}
autoconf
./configure --with-curl=/usr/local
make
make install
tar xzvf git-latest.tar.gz
cd git-{date}
autoconf
./configure --with-curl=/usr/local
make
make install
Thats all there is to it! Simple enough. I will post a follow up on how I actually deploy using Git in the near future.