11.3. Installing Git¶
Git might already be installed on your computer. To find out, run git –version from the command line. If you see a message like git version 2.29.0.windows.1 , you already have Git. If you see a “command not found” error message, you must install Git. On Windows, go to https://git-scm .com/download, and then download and run the Git installer. On macOS Mavericks (10.9) and later, simply run git –version from the terminal and you’ll be prompted to install Git, as shown in Figure 12-2. On Ubuntu or Debian Linux, run sudo apt install git-all from the ter- minal. On Red Hat Linux, run sudo dnf install git-all from the terminal. Find instructions for other Linux distributions at https://git-scm.com/download/ linux. Confirm that the install worked by running git –version .

Figure 12-2: The first time you run git –version on macOS 10.9 or later,you’ll be prompted to install Git. ## Configuring Your Git Username and Email After installing Git, you need to configure your name and email so your commits include your author information. From a terminal, run the follow- ing git config commands using your name and email information:
C::raw-latex:`\Users`:raw-latex:`\Al`>git config –global user.name “Al Sweigart” C::raw-latex:`\Users`:raw-latex:`\Al`>git config –global user.email al@inventwithpython.com
This configuration information is stored in a .gitconfig file in your home folder (such as C::raw-latex:`\Users`:raw-latex:`Al `on my Windows laptop). You’ll never need to edit this text file directly. Instead, you can change it by running the git config command. You can list the current Git configuration settings using the git config –list command. ## Installing GUI Git Tools This chapter focuses on the Git command line tool, but installing software that adds a GUI for Git can help you with day-to-day tasks. Even professional software developers who know the CLI Git commands often use GUI Git tools. The web page at https://git-scm.com/downloads/guis suggests several of these tools, such as TortoiseGit for Windows, GitHub Desktop for macOS, and GitExtensions for Linux.
For example, Figure 12-3 shows how TortoiseGit on Windows adds overlays to File Explorer’s icons based on their status: green for unmodified repo files, red for modified repo files (or folders containing modified files), and no icon for untracked files. Checking these overlays is certainly more convenient than constantly entering commands into a terminal for this information. TortoiseGit also adds a context menu for running Git com- mands, as shown in Figure 12-3.
Using GUI Git tools is convenient, but it’s not a substitute for learning the command line commands featured in this chapter. Keep in mind that you might need to one day use Git on a computer that doesn’t have these GUI tools installed.

Figure 12-3: TortoiseGit for Windows adds aGUI to run Git commands from File Explorer.