Lesson 3 +10 XP

Installing Git

Installing Git

Before you can use Git, you need to install it. It works on Windows, macOS, and Linux.

Check if Git is already installed

Open your terminal and type:

git --version

If you see something like git version 2.39.1, Git is ready. If the command is not found, install Git.

Windows

  1. Go to git-scm.com/downloads.
  2. Download the Windows installer.
  3. Run it and keep the default settings (they are fine for most people).
  4. During installation, you get Git Bash, a terminal built for Git.

macOS

  • Install Xcode Command Line Tools with xcode-select --install.
  • Or download the installer from git-scm.com.
  • Or use Homebrew: brew install git.

Linux

Use your package manager. For Debian/Ubuntu:

sudo apt install git

Verify the install

After installing, run the same check:

git --version

The output looks like this:

git version 2.39.1

TL;DR

  • Check with git --version first.
  • Download Git from git-scm.com for Windows/macOS.
  • Use apt install git on Debian-based Linux.
  • Recheck git --version after installing.