2 min read
Git Setup

A basic guide for setting up Git on your computer

Download and install Git

Mac OS

Install using homebrew:

brew install git

Or install using MacPorts:

sudo port install git
Linux

Install using your distribution’s package manager:

pacman -S git # or your package manager
Windows

Download the installer or use the winget tool:

winget install --id Git.Git -e --source winget

Set username in Git

Set your personal name:

git config --global user.name "Chuck Norris"

Verify the name was set:

git config --global user.name

Set email address in Git

Set your email address (you can use your GitHub-provided noreply emaill address for better privacy):

git config --global user.email "[email protected]"

Verify the email address was set:

git config --global user.email

Set default branch name

Since October 2020, GitHub defaults to main for new repos created through its web interface. Thus, it is advised to change in your Git configuration the default branch name from master to main:

git config --global init.defaultBranch main

Verify the default branch name was set:

git config --global init.defaultBranch