Building Git on Ubuntu 11.10

I struggled a bit with this today but as is often the case, one little tweak (okay, really two) and I was good to go.  I did lots of googling in the process and found many sources for information on building Git from source but most were a bit older and out of date in one way or another.  And, of course, different flavors of Linux also account for some of the differences.  I did start with the “Installing from Source” from the Pro Git free book, and after a few modifications ended up doing exactly the following with success:

  1. Get git dependencies.  The apt-get command to do this given in the Pro Git book simply didn’t work for me – I got a “Unable to locate package …” for each of the packages on that line.  Instead I executed the following command:
    $ sudo apt-get build-dep git-core
  2. This, however, did not get the openssl files so I executed the following to get that package:
    $ sudo apt-get install libssl-dev
  3. Next I downloaded the source from https://github.com/git/git.  I didn’t find a tar file there so clicked on the ZIP button.
  4. Since I got a zip, not a tar I extracted the files using Ubuntu’s Archive Manager.
  5. Changed into the directory I extracted – i.e. /home/cornelia/git-git-5976753
  6. Then executed the following two commands:
    $ sudo make prefix=/usr/local all
    $ sudo make prefix=/usr/local install
  7. Now a
    git --version

    shows me:

    git version 1.7.12.GIT
September 19, 2012 Administrator HowTo No Comments

Share Your Thoughts