How do I update git to its latest version on Linux?

Alice picture Alice · Oct 13, 2013 · Viewed 23k times · Source

I have git version 1.7.4.1. and would like to upgrade to the latest stable release of 1.8.4.

So I tried sudo apt-get install git as it says on the git downloads page for Linux but I get this result:

  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  git is already the newest version.
  0 upgraded, 0 newly installed, 0 to remove and 91 not upgraded.

$ git --version 
  git version 1.7.4.1

and I'm stuck with git version 1.7.4.1!

I am on Ubuntu 11.04.

Answer

vis.15 picture vis.15 · Oct 13, 2013

This is due to Ubuntu has not updated the package yet in their repositories. The only way around this would be to compile from source, which you can download from https://github.com/git/git.