CentOS, Git & http-push unavailable (git not compiled with USE_CURL_MULTI)

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, March 04, 2011

Follow me on Twitter as @mattiasgeniar

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/

# wgethttp://curl.haxx.se/download/curl-7.21.3.tar.gz"

# 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

# wgethttp://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!



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.