Git is available for *nix operating systems, as well as MacOS and Windows.
Debian-based distributions (.deb)
Git is available on Debian, and derivatives like Ubuntu. It is currently packaged as
git. More recent packages of git are available from the Ubuntu Git Maintainers' PPA. You may also want to install some extended git functionality, for example git-svn, which allows two-way interoperability with Subversion, or git-email which provides utility functions for sending and receiving git data (primarily patches) via email.
$ sudo apt-get install git git-svn git-email
RPM-based distributions (.rpm)
Linux distributions using the RPM package format can use yum to get git:
$ sudo yum install git-core
$ sudo port install git-core
Additionally, those with Cygwin can use its setup to obtain Git.
Below is an example of how to compile git from source, change "git-126.96.36.199.tar.gz" to the version you downloaded:
mkdir ~/src cd ~/src wget http://kernel.org/pub/software/scm/git/git-188.8.131.52.tar.gz tar xzvf git-184.108.40.206.tar.gz cd git-220.127.116.11 make configure ./configure --prefix=/usr/local make sudo make install
Without the added
--prefix argument git will currently install to
~/bin. This may or may not be what you want, in most distributions
~/bin is not in the $PATH. Without the --prefix, you might have to explicitly state the path to the component programs on invocation, i.e.:
~/bin/git-add foobar. You can set
--prefix to whatever better suits your particular setup.
The source can additionally be acquired via git using:
$ git clone git://git.kernel.org/pub/scm/git/git.git
Or in the event you have problems with the default Git port of 9418:
$ git clone http://www.kernel.org/pub/scm/git/git.git
- ^ One effort to amend the lack of consistency through modern distributions and
~/bin, has been addressed by the Ubuntu developers which seeks to patch PAM, the authentication mechanism, to set up the environmental variable
$PATH. You can find more information out about this at https://bugs.launchpad.net/ubuntu/+source/pam/+bug/64064.