← Back to Git Course | Chapter 1: Introduction & Setup | Lesson 3 of 7

Git Installation & Setup

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

bash
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

bash
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

bash
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

bash
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

bash
git --version
🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.