Loading lessons...
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
- Go to git-scm.com/downloads.
- Download the Windows installer.
- Run it and keep the default settings (they are fine for most people).
- 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 --versionfirst. - Download Git from git-scm.com for Windows/macOS.
- Use
apt install giton Debian-based Linux. - Recheck
git --versionafter installing.