Skip to Main Content

Software Carpentry

MacOS

Pre-installation configuration

If you are using MacOS 10.15 ("Catalina") or later, you will need to give "Full Disk Access" permissions to the Terminal. If you're using an earlier version of MacOS, you can skip this section.

Instructions for Ventura or Sonoma

  1. Open the System Preferences app
  2. Select Privacy & Security
  3. Select Full Disk Access
  4. Click the toggle next to Terminal to the "on" position. You be asked to enter your password.

Instructions for Catalina, Big Sur, or Monterey

  1. Open the System Preferences app
  2. Select Security and Privacy
  3. Select the Privacy tab
  4. Click the Padlock icon in lower left-hand corner of the window. Enter your user name and password when prompted.
  5. In the left-hand box, scroll down until you find Full Disk Access and select it
  6. If Terminal.app is already listed in the right-hand box, check the box next to it
  7. If Terminal.app isn't listed in the right-hand box, add it:
    1. Click the + icon under the right-hand box
    2. Select the Applications folder. Within Applications, open the Utilities folder and select Terminal.app
    3. Click the Open button
    4. Locate Terminal.app in the right-hand box and check the box next to it
  8. Close System Preferences

Install

Install Git on your Mac using one of the following methods (we list more than one method because sometimes your permissions settings will prevent one of the methods from working).

Method 1

  1. Open the Terminal application by using the Launchpad or by browsing the Utilities folder found under Applications
  2. Type xcode-select --install and press Enter
  3. A window will pop up asking if you would like to install Xcode Command Line Tools. Follow the prompts to install them.

Method 2

  1. Open the Terminal application by using the Launchpad or by browsing the Utilities folder found under Applications
  2. Type clang --version and press Enter
  3. A window will pop up asking if you would like to install Xcode Command Line Tools. Follow the prompts to install them.

Method 3

  1. Visit https://developer.apple.com/download/more/ in your web browser
  2. You will be prompted to log in with an Apple Developer ID (this is different than your Apple ID). Follow the instructions for creating an Apple Developer ID and use it to log into the site.
  3. Download the latest version of Command Line Tools for XCode and install

Verify

  1. Open the Terminal application by using the Launchpad or by browsing the Utilities folder found under Applications
  2. Type git --version and press Enter
  3. You should see a message reporting the version number

Windows

Install

  1. Download the Git for Windows installer.
  2. Run the installer. Click "Next" four times (two times if you've previously installed Git). You don't need to change anything in the Information, Location, Components, or Start Menu screens.
  3. For each configuration screen, select the appropriate option and click "Next":
    1. Choosing the default editor used by git: select "Use the Nano editor by default" from the dropdown menu (you will need to scroll up to find it)
    2. Adjusting the name of the initial branch in new repositories: select "Let Git decide"
    3. Adjusting your PATH environment: select "Git from the command line and also from 3rd-party software" (if you don't do this Git Bash will not work properly, requiring you to remove the Git Bash installation, re-run the installer and to select the "Git from the command line and also from 3rd-party software" option.)
    4. Choosing the SSH executable: select "Use bundled OpenSSH"
    5. Choosing HTTPS transport backend: select "Use the native Windows Secure Channel Library"
    6. Configuring the line ending conversion: select "Checkout Windows-style, commit Unix-style line endings"
    7. Configuring the terminal emulator to use with GitBash: select "Use Windows' default console window"
    8. Choose the default behavior of `git pull`: select "Default (fast-forward or merge)"
    9. Choose a credential helper": select "Git Credential Manager"
    10. Configuring extra options": check the box for "Enable file system caching"
  4. Click "Install".
  5. Click on "Finish" or "Next".
  6. If your "HOME" environment variable is not set (or you don't know what this is):
    1. Open command prompt (Open the Start Menu, type cmd in the search box, and press Enter)
    2. Type the following line into the command prompt window exactly as shown:

      setx HOME "%USERPROFILE%"

    3. Press Enter, you should see SUCCESS: Specified value was saved.
    4. Quit command prompt by typing exit and pressing Enter

This will provide you with both Git and Bash in the Git Bash program.

Verify

  1. Open the GitBash application
  2. Type git --version and press Enter
  3. You should see a message reporting the version number

Linux

Install

If Git is not already available on your machine you can try to install it via your distro's package manager.

  • For Debian/Ubuntu, run
sudo apt-get install git
  • For Fedora, run
sudo dnf install git
  • For other distributions, consult your distro's documentation

Verify

  1. Open your terminal application
  2. Type git --version and press Enter
  3. You should see a message reporting the version number