Development Environment: Git

To work with git in this class, you need the following command-line tools:

Use the following for your particular development environment. Some commands have a button to copy to the clipboard so you can easily copy and paste them into the shell.

Windows: WSL

You must set up WSL (Windows Subsystem for Linux) to use Windows. WSL gives you a proper Linux distribution with a bash shell. While git bash is sufficient for entering git commands, it does not provide a good environment to add or use the other necessary tools.

To install WSL, follow the instructions at Install WSL

After you have installed WSL, you can do the rest of the WSL setup at Set Up WSL.

Now, follow the instructions for Linux & WSL.

Linux & WSL

Enter the following commands into a Linux (or WSL) shell. Each command may ask you to confirm before completion.

  1. Update and upgrade your system:

  2. Install git and gh:

  3. Finally, individually verify that you have all these tools installed:

macOS

macOS comes with git preinstalled, but it is not necessarily the latest version. Also, on macOS, you will want to install Homebrew. So, complete the following.

Enter the following commands in a macOS terminal shell. You can access one by the Terminal app in the Applications folder in the subfolder Utilities. You probably want to drag the Terminal app to your Dock to access it easily.

  1. The command-line tools for git on macOS are part of the Xcode Command Line Tools. You do not have to install the Xcode IDE to use them.

    The easiest way to install the Xcode Command Line Tools without Xcode is to install Homebrew, which you will need in the following steps.

    Follow the installation instructions at Homebrew. As part of the installation, if you haven't already installed the Xcode Command Line Tools, you'll see a message: "The Xcode Command Line Tools will be installed."

  2. One more issue with brew on Apple Silicon (i.e., M series M1/M2/M3/M4) Macs. The brew binaries are placed in the /opt/homebrew/bin directory, which is not on the default path used to look for commands. So, for an Apple Silicon Mac only (not an Intel Mac), enter the following command:

    Close this shell and bring up a fresh one when you are done.

  3. After you upgrade, you can install gh via brew:

  4. Finally, individually verify that you have all these tools installed: