Changing Mailman Python Scripts for Virtual Host Support
ENUMs, User Preferences, and the MySQL SET Datatype
Scrollable Tables with Floating Header using CSS
Enforce Coding Standards with PHP_CodeSniffer and Eclipse IDE on Ubuntu Linux
A Simple ISAPI Filter for Authentication on IIS
Getting Set up with Ogre 3D on Ubuntu

Setting up a Git Repository on CentOS 5

Friday, 29 July 11, 10:16 am
If you are setting up version control, and have access to a managed server, you may decide to create your central repositories on that server, so that all developers can access the repo from wherever they are: in the office, at home, on the beach etc etc

Many managed servers use CentOS, the commercial version of RedHat Linux. If you can find a source repo with git in it, you can install using yum:
yum install git
However, you're quite likely to come up against dependency errors, because some dependencies for git are not in the source repo:
Error: Missing Dependency: perl(Error) is needed by package git-1.7.4.1-1.el5.x86_64 (epel) Error: Missing Dependency: perl-Git = 1.7.4.1-1.el5 is needed by package git-1.7.4.1-1.el5.x86_64 (epel) Error: Missing Dependency: perl(Git) is needed by package git-1.7.4.1-1.el5.x86_64 (epel)
One solution is to install each package individually as an RPM. Use rpmfind.net to find the packages you need. You will need to install the same version of git as of perl-Git.

For CentOS, I got the latest git and perl-Git versions listed for the "Extras Packages for Enterprise Linux 5 for x86_64" distro with EL5 (I knew I had EL5 as it appeared as part of yum's output when I did a yum update). For perl(Error), I grabbed the latest version showing for "DAG packages for Red Hat Linux el5 x86_64".

Once I'd downloaded these three RPMs with wget, I installed them with the following:
rpm -i git-1.7.4.1-1.el5.x86_64.rpm perl-Git-1.7.4.1-1.el5.x86_64.rpm perl-Error-0.17016-1.el5.rf.noarch.rpm
Now that git's installed, you can set up the repository. Go to the folder where the source files are (or will be), and enter:
git init
It'll say that it's initialised an empty repository at .git, even if you have source files in there. This is because you need to add those files and then commit them:
git add . git commit -m "initial import"
The following command will confirm that all has gone to plan:
git status
Hopefully this will tell you "nothing to commit (working directory clean)". Your git repository is now ready to be cloned by any devs who need to work on that code.
 

shekhar

1:12 pm, Monday, 29 October 12

thanks it was really helpful :)
 
 
Leave Comment

/xkcd/ Who?

About This Page