Sunday, March 20, 2011

Git server on CentOS 5.5

This post is adapted from: http://www.davegardner.me.uk/blog/2010/01/29/setting-up-git-on-centos-5-server/

A. Yum Repositories:

You will need EPEL repository:

http://fedoraproject.org/wiki/EPEL


#---
rpm -Uivh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
#---


B. Getting git installed:

1. Install Git and XinetD daemon:
#---
yum -y install \
git \
git-daemon
#---


All your repositories are under [/var/lib/git].

To change that just follow these instructions (I rather not change it):

1.1. Changing Git root dir
#---
MY_GIT_ROOT_DIR=>where will all git projects be<
mkdir -p ${MY_GIT_ROOT_DIR}
chmod 755 ${MY_GIT_ROOT_DIR}
chown root:root ${MY_GIT_ROOT_DIR}
#---

1.2. Adjust the daemon xinetd setup to use the new directory: /etc/xinetd.d/git
...
server_args = --base-path=>where will all git projects be< ...
...


2. Put XinetD to run:

#---
service xinetd restart
chkconfig --level 345 xinetd on
#---


3. Creating a project:

After that you just need to follow the instructions given on the link below:

http://thelucid.com/2008/12/02/git-setting-up-a-remote-repository-and-doing-an-initial-push/