Install Git
Installing brew on Mac
Visit the Git homepage, click [Download for Mac] to download
Open terminal on Mac
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)"
Enter the password you use to log into Mac in terminal
After installation is complete, enter the help command to verify installation was successful
brew help
If you get an error like
zsh: command not found: brew
, it's because you're using an M1 Mac, so enter the command beloweval $(/opt/homebrew/bin/brew shellenv)
Installing Git on Mac
Enter the git installation command in terminal
brew install git
After installation, if version information appears when you enter the version check command, installation is complete!
git --version
Additionally, if you want to change the default branch name from
master
tomain
, enter the command belowgit config --global init.defaultBranch main
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