Appendix A. Git installation

 

Let’s see if Git is already installed on your local machine and install it if needed. Git doesn’t come preinstalled on many operating systems, because it’s a tool typically used by programmers rather than nontechnical computer users. The method required to install Git varies depending on your operating system of choice.

Why are there different versions of Git in this appendix?

The different installation methods and operating systems install different versions of Git. Don’t worry about this; the main differences between newer Git versions and older ones are the helpfulness of the output messages. Version 2.0.0 was the released version at the time of writing, but version 1.8 or above should be sufficient for the needs of this book.

A.1. How to install and run Git on Apple OS X

To verify whether Git is already installed, open a Terminal (either the default OS X /Applications/Utilities/Terminal.app or an alternative such as iTerm.app) and run git --version. If Git is already installed, the output should resemble figure A.1.

Figure A.1. git --version in Terminal.app on OS X Mavericks

A.1.1. Installing Git on Apple OS X Mavericks or newer

If you’re running OS X Mavericks (10.9) or newer and Git wasn’t already installed when you ran git --version, it will prompt you to download and install Git similarly to figure A.2.

Figure A.2. OS X Mavericks Git installation

A.1.2. Installing Git on Apple OS X Mountain Lion or older

A.2. How to install and run Git on Linux or Unix

A.3. How to install and run Git on Microsoft Windows

A.4. Verifying that Git has installed correctly