Mac OS
Homebrew
Install using Homebrew (recommended)
- Install Homebrew if you don’t have it:
1/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - Open the Terminal and Install Git:
1brew install git
MacPorts
Install using MacPorts
- Install MacPorts if you don’t have it: https://www.macports.org/install.php
- Open the Terminal and Install Git:
1sudo port install git
Xcode
Install Using Xcode
- Open the Terminal.
- Run the following command:
1xcode-select --install - Follow the on-screen instructions to install the Command Line Tools.
- After installation, you can use Git from the Terminal.
Linux
Installing Git on Linux involves different steps for each Linux Distribution. Here’s a guide for each distro:
Arch
- Open the Terminal
- Run the following command:
1sudo pacman -S git
Debian
- Open the Terminal
- Run the following commands:
1sudo apt install git
Fedora
(Fedora 22 and later)
- Open the Terminal
- Run the following command:
1sudo dnf install git
Ubuntu
For Ubuntu, this PPA provides the latest stable upstream Git version
- To add PPA open the Terminal & Run the following commands:
1add-apt-repository ppa:git-core/ppa - Run the following commands:
1sudo apt update && sudo apt upgrade -y && sudo apt install git -y
Windows
Official Website
- Visit the official Git website: Git for Windows.
- Click on the “Download” button to download the installer.
- Run the downloaded executable file.
Using Package Manager
Chocolatey
To install Git, run the following command from the Terminal:
| |
Scoop
To install Git, run the following command from the Terminal:
| |
| |
Winget
❗Official Package Manager for Microsoft Windows
To install Git, run the following command from the Terminal:
| |