Updated : Oct 16, 2015 in GIT

Installing a newer git version in Debian/Ubuntu

Introduction:
In many cases where Git is involved it’s possible ethat your distribution doesn’t offer the version of git that is appropriate to the software you want to run. In this case you can install from sources.
Here is one method fro example to install the version 2.4.3.

Steps:
Remove packaged Git
apt-get remove git
If you have other packages that depend on git , apt will most probably prevent the de-installation of git. In that case you can run the following command:
dpkg --force-depends -r git
Install dependencies
apt-get install -y libcurl4-openssl-dev libexpat1-dev gettext libz-dev libssl-dev build-essential
Download and compile from source
cd /tmp
curl -L --progress https://www.kernel.org/pub/software/scm/git/git-2.4.3.tar.gz | tar xz
cd git-2.4.3/
./configure
make prefix=/usr/local all

Install into /usr/bin
make prefix=/usr/local install
Check the git version
git --version

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: