Sunday, September 25, 2011

How to install GIT on LINUX

it was true in 2008 and it is still true in 2010. While "msysgit" provides good Windows port of Git I preferred to experience the real one.
Naturally, there are a number of ways to install Git on Linux, Ubuntu 10.04 in my case.








$which git
$sudo apt-get install git-core
$which git
/usr/bin/git
$git --version
git version 1.7.0.4
This is the easiest way, of course, but it brings us an outdated version of Git. Latest Git version is "1.7.2.3", let’s download it from git-scm.com (kernel.org/pub/software/scm/git/) and install manually.











$tar -xvf git-1.7.2.3.tar.gz
$cd git-1.7.2.3/
$sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev
$make prefix=/usr/local all
$sudo make prefix=/usr/local install
$which git
/usr/local/bin/git
$git --version
git version 1.7.2.3
Much better! We now have the latest Git version installed. Can it be better?
Oh yes ..

















$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
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
...
   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
Ahh, living on the bleeding edge :)

No comments: