Install Git on Windows, macOS and Linux
Check whether Git is already installed
Git is a program that runs on your computer. Before installing anything, open a terminal and ask Git to report its version. A result such as git version 2.47.3 means this terminal can start Git. Your version may differ. You do not need a GitHub account.
Choose the installation for your system
Windows: use the Git for Windows installer linked from https://git-scm.com/install/windows and open Git Bash after installation. macOS: use Apple’s command line developer tools if offered when running Git, or use Homebrew if you already have it installed. Linux: use the package manager for your distribution. WSL: open your Linux distribution and install its Linux Git there, rather than assuming Windows Git is the same installation. Use trusted sources and follow your organization’s installation policy.
Example: Debian or Ubuntu
If Git is absent on Debian or Ubuntu, the following commands refresh package metadata and install Git. They may request administrator permission and download packages. Run them only on a machine where you are allowed to install software. Other distributions use different package managers. These installation commands were documentation-reviewed, not executed in this lesson’s lab.
If the command is not found
A shell error such as git: command not found in Bash means Git could not be located by that shell. It may be missing, or its executable directory may not be in PATH (the list of places the shell searches). Reopen the terminal after installation and try again. In Bash, command -v git shows the command location when found. In PowerShell, use Get-Command git. Do not download an unknown executable to fix PATH.
Practice and next step
Write down your operating system, terminal and reported version. For this course, the tested baseline is Git 2.47.3 on Debian; the initial-branch option used later requires Git 2.28 or newer. A newer supported client from your trusted installation source is fine. If you have not obtained a version result, solve that first. Next, learn how to navigate a practice directory and find Git help.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Install Git on Windows, macOS and Linux — knowledge check
Apply the lesson to common beginner scenarios.
What does a successful git --version result establish?
Git is installed on Windows, but you work inside Ubuntu on WSL. What should you check?
Bash reports git: command not found after installation. What is a sensible first step?
Which installation approach suits Debian?
Your version differs from the lab’s 2.47.3. What should you do?