How to Install Git on Windows, macOS, and Linux
Git is available for Windows, macOS, and Linux. The simplest installation method depends on your operating system: use the official installer or a trusted package manager, then confirm the command is available in your terminal. Follow the steps below to install Git and configure the identity shown on your commits.
Practice Git workflows →Check whether Git is already installed
Open a terminal: use PowerShell or Windows Terminal on Windows, Terminal on macOS, or your preferred terminal on Linux. Run:
git --versionIf the command prints a Git version, Git is available in that terminal. You can continue to the configuration step. If the terminal says the command was not found or is not recognized, use the instructions for your operating system below.
Install Git on Windows
Download the Git for Windows installer from the official Git for Windows download page. Run the installer and follow its prompts. If you are unsure about an option, the defaults are generally suitable for getting started. Git for Windows includes Git Bash as well as Git command-line support for Windows terminals.
If you use Windows Package Manager and it is available on your system, you can install Git from PowerShell or Windows Terminal:
winget install --id Git.Git -e --source wingetAfter installation, open a new terminal window and run git --version. If Windows still cannot find Git, reopen the terminal or check that the installer added Git to your PATH.
Install Git on macOS
One option is Apple’s Command Line Tools. In Terminal, run:
xcode-select --installFollow the macOS prompt to install the tools. If they are already installed, macOS may tell you so. Open a new Terminal window and check with git --version.
If you already use Homebrew, you can install or update Git with:
brew install gitChoose one method to start. If you have multiple Git installations, check which one your shell uses with which git and confirm the version with git --version.
Install Git on Linux
Install Git with your distribution’s package manager. Use the command for your distribution; package names and exact commands may vary across versions:
Debian or Ubuntu
sudo apt update
sudo apt install gitFedora
sudo dnf install gitArch Linux
sudo pacman -S gitUse your distribution’s documentation if it uses another package manager or requires a different command. When installation finishes, run git --version to verify it.
Configure your Git name and email
Git records a name and email address in each commit’s author information. Set the identity you want associated with new commits:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"Replace the example values with your own. The --global option applies the identity to your user account on this computer; omit it to configure a different identity only for the current repository. This setting does not sign you in to GitHub or control repository access. Check the saved values with git config --global --list.
Verify Git is ready to use
Confirm the installed version and, if you configured it, your commit identity:
git --version
git config --global user.name
git config --global user.emailGit is ready when the version command succeeds. You can now create a repository with git init or copy an existing project with git clone.
Frequently asked questions
Is Git the same as GitHub?
No. Git is version control software installed on your computer. GitHub is an online service that hosts Git repositories and provides collaboration tools. You can use Git locally without a GitHub account.
Do I need administrator access to install Git?
It depends on your operating system, installation method, and device policies. Some package managers or installers may request elevated permissions. On a managed computer, follow your organization’s software installation process.