Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Appendix

Install Git on Windows, macOS, and Linux

This workshop requires Git to be installed on your local machine. Follow the instructions below for your operating system.


Windows (WSL)

WSL provides a full Linux environment on Windows and is recommended for this workshop.

Prerequisites:

Installation steps:

  1. Install WSL:

    • Open PowerShell or Command Prompt as Administrator

    • Run:

      wsl --install
    • Restart your computer when prompted

  1. After restart, set up your Linux distribution:

    • A terminal window will open automatically

    • Create a username and password when prompted

    • This will be your Linux user account (separate from your Windows account)

  2. Install Git in WSL:

    • Open your WSL terminal (Ubuntu, or your chosen distribution)

    • Update package lists:

      sudo apt update
    • Install Git:

      sudo apt install git
  3. Verify the installation:

    git --version

    You should see a version number (e.g., git version 2.43.0).

  4. Configure Git (see Post-installation section below)

Accessing your Windows files from WSL:

Opening WSL:


macOS

Option 1: Install via Xcode Command Line Tools (simplest)

  1. Open Terminal (Applications → Utilities → Terminal).

  2. Run:

    git --version
  3. If Git is not installed, macOS will prompt you to install the Command Line Developer Tools.

    • Click Install and follow the prompts.

  4. After installation completes, verify:

    git --version

If you already use Homebrew:

  1. Install Git:

    brew install git
  2. Verify the installation:

    git --version

Linux

Option 1: Installing Git on Ubuntu / Debian

  1. Open a terminal.

  2. Update your package index:

    sudo apt update
  3. Install Git:

    sudo apt install git
  4. Verify the installation:

    git --version

    You should see a version number (for example, git version 2.43.0).


Option 2: Installing Git on Fedora / RHEL / Rocky / AlmaLinux

  1. Open a terminal.

  2. Install Git:

    sudo dnf install git
  3. Verify the installation:

    git --version

Option 3: Installing Git on Arch Linux / Manjaro

  1. Open a terminal.

  2. Install Git:

    sudo pacman -S git
  3. Verify the installation:

    git --version

Option 4: Installing Git on openSUSE

  1. Open a terminal.

  2. Install Git:

    sudo zypper install git
  3. Verify the installation:

    git --version

D. Post-installation (All Platforms)

After installing Git, configure your name and email (required for commits):

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

You can confirm your settings with:

git config --global --list

E. Troubleshooting

WSL-specific troubleshooting:


Configure SSH Authentication with GitHub

This section shows how to create and configure an SSH key so you can push commits from your local machine to GitHub.


Step 1. Install and/or enable SSH on your laptop

Windows (WSL)

WSL provides a Linux-like environment that was installed in the section “Installing Git on Windows

Open your WSL distro (e.g., Ubuntu), then:

sudo apt update
sudo apt install git openssh-client

macOS

Most macOS systems include Git and SSH via Apple’s command line tools.

Verify:

git --version
ssh -V

If needed:

xcode-select --install

Linux (Ubuntu/Debian)

sudo apt update
sudo apt install git openssh-client

Step. 2 Generate an SSH key

In a terminal, run the following command to create the key:

ssh-keygen -t ed25519 -C "your_email@example.com"

Step 3. Set the key’s permissions

Set secure file permissions on your private key. SSH requires strict permissions on your key files and .ssh directory. Run the following commands:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_ed25519
chmod 644 ~/.ssh/id_ed25519.pub

What these do:

Step. 4 Start the SSH agent and add your key

Run the following commands to start the SSH agent process and then add your key to the process so you can authenticate with SSH.

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

Step. 5 Add your public key to GitHub

Copy your public key content by running the following command:

cat ~/.ssh/id_ed25519.pub

Copy the key content from the output of the command, it should look something like:

ssh-ed25519 AAAAAAAAAAfsjkldfaieaflkfnc4598035jnsdfksdlcnswef03248slffjklsfjklsd90 your_email@example.com

Then in GitHub:

  1. Go to GitHub → Settings

  2. Click SSH and GPG keys

  3. Click New SSH key

  4. Paste the key

  5. Click Add SSH key

Step. 6 Test your SSH connection

ssh -T git@github.com

Expected output looks like:

Hi USERNAME! You've successfully authenticated...

Step. 7 Make sure your repo remote uses SSH (optional)

When cloning, use the SSH URL:

git clone git@github.com:USERNAME/REPO.git

If you already cloned with HTTPS, switch the origin remote:

git remote -v
git remote set-url origin git@github.com:USERNAME/REPO.git
git remote -v