Install Git

Installing brew on Mac

  1. Visit the Git homepage, click [Download for Mac] to download

  2. Open terminal on Mac

  3. Visit the Homebrew homepage, then enter the command below in terminal

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  4. Enter the password you use to log into Mac in terminal

  5. After installation is complete, enter the help command to verify installation was successful

    brew help
  6. If you get an error like zsh: command not found: brew, it's because you're using an M1 Mac, so enter the command below

    eval $(/opt/homebrew/bin/brew shellenv)

Installing Git on Mac

  1. Enter the git installation command in terminal

    brew install git
  2. After installation, if version information appears when you enter the version check command, installation is complete!

    git --version
  3. Additionally, if you want to change the default branch name from master to main, enter the command below

    git config --global init.defaultBranch main
  4. If you're using git for the first time on this device, enter the commands below in order

    git config --global user.email "ella@gmail.com"
    git config --global user.name "Ella"

Last updated