Installing git from source on Centos 6.x


Couldn't clone github repos via https:// sources from Centos 6.2 boxes.

This is a problem, because the situation often arises where I developed some code for a client, and need to put the repo on their server without giving them write access to the github repo.

git clone

was throwing an error:

Error: The requested URL returned error: 403 while accessing # # fatal: HTTP request failed 

From it was determined that the git version installed via

yum install git

(1.7.1), didn't support cloning from https.



Needed to build git from source.

Here are the steps to successfully build git on Centos 6.2:

*All commands are ran as "root"

  1. Remove git if you have it installed from yum
    yum remove git

  2. Install the dependencies for build, and grab the git source code
    note: you will want to change the version number to whichever git version you want to install. I chose the latest git version at the time of this post, You'll want at least 1.7.10 to clone from https://
    cd ~/
    yum install gcc make gcc-c++ zlib-devel perl-ExtUtils-Embed gettext curl-devel expat-devel
    tar -zxvf git- 

  3. Build git
    cd git- && ./configure && make && make install
  4. Link it in /usr/bin
    ln -s /root/git- /usr/bin/ 


You should be all set!


Ricardo (not verified)

Wed, 04/17/2013 - 23:02

Thanks a lot!