Skip to content

Instantly share code, notes, and snippets.

@nbomberger
Last active December 19, 2015 20:18
Show Gist options
  • Save nbomberger/6011969 to your computer and use it in GitHub Desktop.
Save nbomberger/6011969 to your computer and use it in GitHub Desktop.
Install Git from Source on Linux

To install Git, you need to have the following libraries that Git depends on: curl, zlib, openssl, expat, and libiconv. For example, if you’re on a system that has yum (such as Fedora) or apt-get (such as a Debian based system), you can use one of these commands to install all of the dependencies:

$ yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel

$ apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev

When you have all the necessary dependencies, you can go ahead and grab the latest snapshot from the Git web site:

http://git-scm.com/download

Then, compile and install:

$ tar -zxf git-1.7.2.2.tar.gz
$ cd git-1.7.2.2
$ make prefix=/usr/local all
$ sudo make prefix=/usr/local install

After this is done, you can also get Git via Git itself for updates:

$ git clone git://git.kernel.org/pub/scm/git/git.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment