Appendix B. Installing Git

So, before you can use Git, you must install it. The steps to install Git depend greatly on the vendor and version of your operating system. This appendix describes how to install Git on Linux, macOS, and Microsoft Windows. We also share how you can obtain the Git source code and then build and install from it.

Using Linux Binary Distributions

Many Linux vendors provide precompiled, binary packages to make the installation of new applications, tools, and utilities easy. Each package specifies its dependencies, and the distribution’s package manager typically installs the prerequisites and the desired package in one (well-orchestrated and automated) fell swoop.

Debian/Ubuntu

On most Debian and Ubuntu systems, Git is offered as a collection of packages, where each package can be installed independently depending on your needs. Prior to the 12.04 release, the primary Git package was called git-core. As of the 12.04 release, it is simply called git. Examples of other git packages include git-gui, gitk, gitweb, and git-svn.

Because distributions vary greatly, it’s best to search your distribution’s package depot for a complete list of Git-related packages.

This command installs the latest (stable) version of Git on your Debian/Ubuntu operating system:

   $ apt-get install git
   

Other Binary Distributions

To install Git on other Linux distributions, find the appropriate package or packages, and use the distribution’s native package manager to install ...

Get Version Control with Git, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.