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 https://github.com/user/repo.git
was throwing an error:
Error: The requested URL returned error: 403 while accessing # https://github.com/user/repo.git/info/refs # fatal: HTTP request failed
From https://help.github.com/articles/https-cloning-errors 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"
- Remove git if you have it installed from yum
yum remove git
- 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, 126.96.36.199. 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 wget http://git-core.googlecode.com/files/git-188.8.131.52.tar.gz tar -zxvf git-184.108.40.206.tar.gz
- Build git
cd git-220.127.116.11 && ./configure && make && make install
- Link it in /usr/bin
ln -s /root/git-18.104.22.168/git /usr/bin/
You should be all set!