Installing Git is easy and fast, as it comes with pre-configured packages for most systems. For the sake of completeness, however, we’ll document the most important steps under Linux, Mac OS X, and Windows.
Due to the large number of Linux distributions only the installation on Debian, Fedora and Gentoo systems is described here. For other distributions, please refer to the documentation or the package management system, if necessary; of course, you can also compile and install Git from source code.
Debian and Ubuntu provide ready-to-use packages that can be installed comfortably and quickly with the Debian package management system. The git installation is modularized, so you can install only certain parts of git if necessary.
main package, contains core commands (formerly
Add-on for sending patches by e-mail
Graphical user interface
svnto interact with Subversion repositories
Interaction with CVS
documentation (will be installed under
There is also a meta-package
git-all which installs all relevant packages.
So on a regular workstation you should install Git as follows:
$ sudo aptitude install git-all
Under Ubuntu you can install the package
git-all via the graphical package manager Synaptic.
On a Fedora system, you should install Git using the package manager
$ sudo yum install git
Analogous to the division into smaller packages as in Debian, certain additional features for Git are available in separate packages.
To install all commands, you should install the
Gentoo provides the ebuild
The graphical tool for creating commits (
git gui) and the add-on for sending emails (
git send-email) are installed by default.
If you want to have a graphical user interface for viewing and editing the history (
gitk) in addition, enable the USE flag `tk`.
If you plan to use the Subversion interface, enable the
subversion USE flag.
To install via Portage, type the following command:
$ sudo emerge dev-vcs/git
If your distribution doesn’t provide a package for Git, it’s outdated, or you don’t have root privileges on the system, you should install Git directly from source.
Git depends on the five libraries
expat (XML parser),
curl (data transfer),
pcre (regular expressions) and
You may need to compile their sources and install the libraries accordingly before proceeding.
First download the tarball of the current Git version and unzip it:
$ wget https://www.kernel.org/pub/software/scm/git/git-2.1.0.tar.gz $ tar xvf git-2.1.0.tar.gz
Now change to the
git-2.1.0/ directory and compile the source code; then run
$ cd git-2.1.0/ $ make -j8 $ make install
make prefix=<prefix> you can install Git to
The Git for OS X project provides an installation program in disk image format (DMG). So you can install it as usual.
The project Git for Windows provides an installation program for Microsoft Windows: msysGit. You can download the program and install it as usual.