Git Installation & Setup
In this page:
Installing on Windows
On Windows, download the official installer from git-scm.com; it bundles Git Bash, a Unix-style terminal emulator, so you get the same command syntax used in every Git tutorial and by developers on macOS or Linux.
Example: Installing on Windows
winget install --id Git.Git -e --source winget
Installing on macOS
On macOS, Git usually ships through the Xcode Command Line Tools rather than a separate installer -- open Terminal, run any git command, and macOS will prompt you to install the tools automatically if they're missing.
Example: Installing on macOS
xcode-select --install
Installing on Linux
On Linux, Git comes from your distribution's package manager, so the exact command depends on your flavor: apt install git on Debian/Ubuntu, yum install git (or dnf) on Red Hat/CentOS/Fedora.
Example: Installing on Linux
sudo apt install git
sudo yum install git
Opening Git Bash or Terminal
Once installed, all Git commands are typed into a terminal-style interface -- Git Bash on Windows, or the built-in Terminal app on macOS and Linux -- since Git itself has no graphical interface of its own by default.
Example: Opening Git Bash or Terminal
git help
Initial Verification
After installing, it's worth running a quick version check to confirm the Git binary is reachable from your terminal; catching a broken PATH now is much less confusing than debugging a mysterious 'command not found' error later.
Example: Initial Verification
git --version
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: