Git Academy

Beginner · 5 min read

Install Git

Windows, macOS or Linux: install Git, check it works, tell it who you are.

Windows

With winget (built into Windows 10 and 11), or download the installer from git-scm.com. The default options are fine. It also installs Git Bash, a Linux-like terminal.

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

macOS

Git comes with Apple's command line tools: the first command offers to install them. With Homebrew, the second one gets a more recent version.

Safe
$ xcode-select --install
# or, with Homebrew:
$ brew install git

Linux

Use your distribution's package manager.

Safe
# Debian / Ubuntu
$ sudo apt install git
# Fedora
$ sudo dnf install git
# Arch
$ sudo pacman -S git

Check and introduce yourself

Open a new terminal and check the version. Then set your name and email: they are written in every commit you make.

Safe
$ git --version
$ git config --global user.name "Your Name"
$ git config --global user.email "you@example.com"
$ git config --global init.defaultBranch main