Installing Git
Table of contents
- Prerequisites
- Installation on Windows
- Installation on macOS
- Installation on Linux
- Verifying the installation
- First launch
1 - Prerequisites
Before installing Git, make sure you have:
- Administrator rights on your machine
- Internet connection to download the files
- Disk space: about 300 MB available
💡 Tip: Close all terminals and code editors before installation to avoid conflicts.
🔝 Back to table of contents
2 - Installation on Windows
2.1 Download
-
Go to the official website: https://git-scm.com/download/win
-
The download should start automatically
-
If it doesn't, click the link matching your system:
- 64-bit Git for Windows Setup (recommended)
- 32-bit Git for Windows Setup
2.2 Recommended installation options
During installation, here are the options to select:
| Step | Recommended option |
|---|---|
| Select Components | ✅ All default options |
| Default editor | Visual Studio Code (or your preferred editor) |
| Initial branch name | Let Git decide (main) |
| PATH environment | Git from the command line and also from 3rd-party software |
| SSH executable | Use bundled OpenSSH |
| HTTPS transport | Use the OpenSSL library |
| Line ending | Checkout Windows-style, commit Unix-style line endings |
| Terminal emulator | Use MinTTY |
| Default behavior of git pull | Default (fast-forward or merge) |
| Credential helper | Git Credential Manager |
| Extra options | ✅ Enable file system caching |
2.3 Verification on Windows
Open PowerShell or Git Bash and type:
git --version
Expected result:
git version 2.43.0.windows.1
🔝 Back to table of contents
3 - Installation on macOS
3.1 Via Homebrew (Recommended)
If you don't have Homebrew, install it first:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then install Git:
brew install git
3.2 Via the official installer
-
Download from: https://git-scm.com/download/mac
-
Open the downloaded
.dmgfile -
Follow the installation instructions
Alternative: Git is included with the Xcode Command Line Tools:
xcode-select --install
3.3 Verification on macOS
Open the Terminal and type:
git --version
Expected result:
git version 2.43.0
🔝 Back to table of contents
4 - Installation on Linux
4.1 Ubuntu / Debian
sudo apt update
sudo apt install git
4.2 Fedora / CentOS / RHEL
Fedora:
sudo dnf install git
CentOS / RHEL:
sudo yum install git
4.3 Arch Linux
sudo pacman -S git
4.4 Verification on Linux
git --version
Expected result:
git version 2.43.0
🔝 Back to table of contents
5 - Verifying the installation
After installation, check that Git works correctly:
5.1 Git version
git --version
5.2 Location of the executable
Windows (PowerShell):
Get-Command git
macOS / Linux:
which git
5.3 Git help
git help
This command displays the list of all available Git commands.
🔝 Back to table of contents
6 - First launch
Congratulations! Git is now installed on your machine. 🎉
Next steps
Before you start using Git, you need to:
- Create a GitHub account (next chapter)
- Configure Git with your name and email
- Generate an SSH key for secure connections
Useful commands to remember
| Command | Description |
|---|---|
git --version | Displays the Git version |
git help | Displays general help |
git help <commande> | Help on a specific command |
git config --list | Lists the current configuration |
💡 Tip: Keep Git up to date! Regularly check for new versions at git-scm.com.