Last Updated: February 25, 2016
·
638
· freiden

Install Git on Linux from git source

Originaly from http://evgeny-goldin.com/blog/3-ways-install-git-linux-ubuntu/

$git clone git://git.kernel.org/pub/scm/git/git.git
$cd git
$git tag
...
v1.7.2.3
v1.7.3-rc0
v1.7.3-rc1
v1.7.3-rc2
$git checkout v1.7.3-rc2
$make prefix=/usr/local all
$sudo make prefix=/usr/local install
$which git
/usr/local/bin/git
$git --version
git version 1.7.3.rc2

If build failed installed gettext package
debian/ubuntu example: sudo apt-get install gettext

Now, we can periodically take a look at http://git.kernel.org/?p=git/git.git;a=tags and run "git fetch" to get updates committed by Git developers.

$git fetch
...
From git://git.kernel.org/pub/scm/git/git
   f17c1de..ac752fa  html       -> origin/html
   525f768..4693a7d  man        -> origin/man
   14d8729..87b5054  master     -> origin/master
   4a2aa5e..7bba3dd  next       -> origin/next
 + ce883eb...31195da pu         -> origin/pu  (forced update)
  46b1f9b..5fba457  todo       -> origin/todo
 * [new tag]         v1.7.3     -> v1.7.3

$git checkout v1.7.3
$make prefix=/usr/local all
$sudo make prefix=/usr/local install
$git --version
git version 1.7.3