Ah yes, another “damn, the default package on CentOS is too old to support it”-thing.
If you’re running git, and want to use the ‘git http-push’ options (to push to a DAV-enabled webserver, for instance), you’ll find the default curl install on a CentOS 5.x system is too old.
# git http-push
fatal: git-push is not available for http/https repository when not compiled with USE_CURL_MULTI
To check your current curl version.
# rpm -qa | grep -i curl
curl-devel-7.15.5-9.el5
curl-7.15.5-9.el5
And the documentation of http-push tells you this.
DESCRIPTION
-–-–-—-
Sends missing objects to remote repository, and updates the remote branch.
*NOTE*: This command is temporarily disabled if your libcurl is older than 7.16, as the combination has been reported not to work and sometimes corrupts repository.
Bummer for every CentOS user. So, we’ll fix it.
Solution: build the latest version of curl yourself from source
First, remove the current curl library. Before you confirm, make sure no (important) dependencies come along.
# yum remove curl curl-devel
And download the latest version from the Curl project page.
# cd /usr/local/src/
# tar xzf curl-7.21.3.tar.gz
# rm curl-7.21.3.tar.gz
# ln -s curl-7.21.3 curl
# cd curl/
And start your compilation. Remove the “–libdir=/usr/lib64” if you’re not running on a 64-bit architecture.
# make clean
# ./configure –libdir=/usr/lib64 –with-libssh2 –enable-shared –prefix=/usr
# make
# make install
As a final task, recompile your git with the “–with-curl” option.
# cd /usr/local/src
# wget “http://kernel.org/pub/software/scm/git/git-1.7.4.tar.bz2"
# bunzip2 git-1.7.4.tar.bz2
# tar xf git-1.7.4.tar
# rm git-1.7.4.tar
# ln -s git-1.7.4 git
# cd git/
# make clean
# ./configure –with-curl=/usr/bin
# make && make install
You should now be able to run ‘git http-push’ and get the basic usage information.
# git http-push
usage: git http-push [–all] [–dry-run] [–force] [–verbose]
[…]
Way too much effort for something relatively simple!