Skip to main content

Installing Git


Table of contents


  1. Prerequisites
  2. Installation on Windows
  3. Installation on macOS
  4. Installation on Linux
  5. Verifying the installation
  6. 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

  1. Go to the official website: https://git-scm.com/download/win

  2. The download should start automatically

  3. If it doesn't, click the link matching your system:

    • 64-bit Git for Windows Setup (recommended)
    • 32-bit Git for Windows Setup

During installation, here are the options to select:

StepRecommended option
Select Components✅ All default options
Default editorVisual Studio Code (or your preferred editor)
Initial branch nameLet Git decide (main)
PATH environmentGit from the command line and also from 3rd-party software
SSH executableUse bundled OpenSSH
HTTPS transportUse the OpenSSL library
Line endingCheckout Windows-style, commit Unix-style line endings
Terminal emulatorUse MinTTY
Default behavior of git pullDefault (fast-forward or merge)
Credential helperGit 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



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

  1. Download from: https://git-scm.com/download/mac

  2. Open the downloaded .dmg file

  3. 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:

  1. Create a GitHub account (next chapter)
  2. Configure Git with your name and email
  3. Generate an SSH key for secure connections

Useful commands to remember

CommandDescription
git --versionDisplays the Git version
git helpDisplays general help
git help <commande>Help on a specific command
git config --listLists the current configuration

💡 Tip: Keep Git up to date! Regularly check for new versions at git-scm.com.

🔝 Back to table of contents