Every developer hits this moment. You’re ready to start coding, collaborate on a project, or contribute to open source. But first, you need to learn how to install Git on your machine.
Git is the most widely used distributed version control system in the world. Linus Torvalds created it in 2005. Today, it powers millions of repositories on platforms like GitHub, GitLab, and Bitbucket.
This guide walks you through installation on Windows, macOS, and Linux. You’ll configure your username and email, verify the setup works, and troubleshoot common issues.
Takes about 10 minutes. No prior experience required.
How to Install Git

Installing Git is the process of setting up a distributed version control system on your local machine.
Developers need this when tracking code changes, collaborating with teams, or managing a codebase across multiple contributors.
This guide covers installation steps for Windows, macOS, and Linux. Takes 5-15 minutes depending on your operating system. Beginner-friendly with no prior experience required.
Prerequisites
Before you install Git, check these requirements:
- Operating system: Windows 10/11, macOS 12+, Ubuntu 20.04+, or similar Linux distributions
- Permissions: Administrator access (Windows) or sudo privileges (macOS/Linux)
- Internet connection: Required for downloading the installer package
- Disk space: Approximately 300 MB free
- Time estimate: 5-15 minutes
No prior software development experience needed. The installation wizard handles most configuration automatically.
Step One: How Do You Download the Git Installer for Your Operating System?
Visit git-scm.com/downloads and select your operating system. The website detects your platform and recommends the correct version. Click the download button matching your system architecture.
Action
- git-scm.com/downloads: Navigate to the official Git download page
- Select OS: Click Windows, macOS, or Linux/Unix
- Choose version: 64-bit for modern systems, 32-bit for older machines
- Result: Installer file downloads to your default folder
Purpose
The official Git SCM website provides verified, secure installers. Third-party sources may contain outdated versions or bundled software you don’t want.
Step Two: How Do You Run the Git Installation on Windows?
Locate the downloaded executable file in your Downloads folder. The filename follows the pattern Git-2.xx.x-64-bit.exe. Double-click to launch the installation wizard.
Action
- Downloads folder: Find Git-2.xx.x-64-bit.exe
- User Account Control: Click Yes when prompted
- License agreement: Read and click Next
- Installation path: Keep default C:Program FilesGit or customize
- Component selection: Leave defaults checked, including Git Bash
- Result: Progress bar completes, Git installs to your system
Configuration Options During Setup
Default Editor
The wizard asks which text editor Git should use. Vim is the default. Most beginners prefer Visual Studio Code or Notepad++.
PATH Environment
Select “Git from the command line and also from 3rd-party software.” This adds Git to your system environment variables automatically.
Line Ending Conversions
Choose “Checkout Windows-style, commit Unix-style line endings” for cross-platform compatibility.
Purpose
Running as administrator ensures Git can write to protected system directories. The PATH configuration lets you run Git commands from Command Prompt or PowerShell.
Step Three: How Do You Install Git on macOS Using Homebrew?
Homebrew is a package manager that simplifies software installation on Mac. One terminal command downloads, configures, and installs Git with all dependencies.
Action
- Terminal: Open from Applications > Utilities > Terminal
- Check Homebrew: Type
brew --versionand press Enter - Install Git: Type
brew install gitand press Enter - Wait: Homebrew downloads and installs automatically
- Result: Terminal displays “Installation successful”
No Homebrew Installed?
Visit brew.sh and copy the installation command. Paste it into Terminal. The script installs Homebrew first, then you can proceed with brew install git.
Alternative: Standalone Installer
Download Method
Go to git-scm.com/download/mac for the .dmg file. Double-click the downloaded file, then run the .pkg installer inside.
Xcode Command Line Tools
macOS may prompt you to install Xcode Command Line Tools. Accept the prompt. This provides compiler tools Git needs for certain operations.
Purpose
Homebrew keeps Git updated with a simple brew upgrade git command. The standalone installer requires manual updates by downloading new versions from the website.
Step Four: How Do You Install Git on Ubuntu or Debian Linux?
Linux distributions use the APT package manager for software installation. Two terminal commands handle everything.
Action
- Terminal (Ctrl+Alt+T): Open the command line interface
- Update packages: Type
sudo apt updateand press Enter - Install Git: Type
sudo apt install gitand press Enter - Password prompt: Enter your sudo password
- Confirm: Type Y when asked to continue
- Result: APT downloads and installs Git automatically
Fedora, CentOS, or Red Hat
Use DNF instead of APT. Run sudo dnf install git for Fedora. CentOS and RHEL users run sudo yum install git.
Purpose
Running apt update first refreshes the package index. Skipping this step may install an outdated Git version from cached repositories.
Step Five: How Do You Configure Your Git Username and Email?
Git requires identity configuration before you can commit changes. The git config command stores your name and email globally.
Action
- Open terminal: Git Bash (Windows), Terminal (macOS/Linux)
- Set username:
git config --global user.name "Your Name" - Set email:
git config --global user.email "you@example.com" - Result: Git saves credentials to ~/.gitconfig file
Global vs Local Configuration
Global Settings
The --global flag applies settings to all repositories on your machine. Stored in your home directory.
Local Settings
Run commands without --global inside a specific Git repository. Local settings override global ones for that project only.
Purpose
Every Git commit records who made the change. Teams use this information for code reviews, blame tracking, and collaboration on remote repositories.
Verification
How Do You Confirm Git Installed Correctly?
Run a quick version check to verify installation success.
Action
- Open terminal: Command Prompt, PowerShell, or Terminal
- Check version: Type
git --versionand press Enter - Expected output:
git version 2.xx.x - Verify config: Type
git config --list - Expected output: Your username and email appear in the list
Version number confirms Git runs properly. Config list shows your identity settings saved correctly.
Troubleshooting
Issue: ‘git’ Is Not Recognized as a Command (Windows)
Windows cannot find the Git executable. The PATH environment variable needs updating.
Solution
- Windows Search: Type “Environment Variables”
- System Properties: Click “Environment Variables” button
- System variables: Find and select “Path”, click Edit
- Add path: Click New, enter
C:Program FilesGitcmd - Save: Click OK on all windows
- Restart terminal: Close and reopen Command Prompt
Issue: Permission Denied During Installation (Linux/macOS)
The current user lacks administrative privileges for system directories.
Solution
- Add sudo: Prefix your command with
sudo - Authenticate: Enter your user password when prompted
- Retry: Run the installation command again
Issue: Homebrew Not Found (macOS)
Homebrew is not installed on your system yet.
Solution
- Visit brew.sh: Copy the installation script
- Terminal: Paste and run the Homebrew installer
- Restart: Close and reopen Terminal
- Retry: Run
brew install git
Issue: Old Git Version After Installation
Multiple Git installations exist; the system uses the older one.
Solution
- Check location: Run
which git(macOS/Linux) orwhere git(Windows) - Compare paths: Verify the path points to your new installation
- Update PATH: Move the new Git path before older entries
Next Steps and Related Processes
Git installation complete. Time to start using it.
Immediate Next Actions
- Create your first repository: Run
git initin any project folder - Clone existing code: Learn how to clone a Git repository from GitHub or GitLab
- Understand staging: Read about staging in Git before making commits
Connect to Remote Platforms
Git works locally, but most teams use remote hosting. GitHub is the most popular platform for open source projects.
Learn the difference between Git and GitHub before creating your account.
Branch Management
Branches let you work on features without affecting the main code. Start with how to create a new branch in Git.
Team Workflows
Git integrates with DevOps pipelines and continuous integration systems.
Understanding source control management principles helps you collaborate effectively on any development team.
FAQ on How To Install Git
Is Git Free to Install?
Yes. Git is open source software released under the GNU General Public License. Download it from git-scm.com at no cost. No subscriptions, no hidden fees, no premium tiers.
How Do I Check If Git Is Already Installed?
Open your terminal or command prompt. Type git --version and press Enter. If installed, you’ll see a version number like “git version 2.43.0”. No output means Git isn’t installed yet.
What Is the Difference Between Git and GitHub?
Git is the version control software running locally on your machine. GitHub is a cloud platform for hosting repositories. You need Git installed to push code to GitHub.
Do I Need Administrator Rights to Install Git?
On Windows, yes. The installer writes to Program Files and modifies system environment variables. Linux and macOS require sudo privileges for system-wide installation. User-level installs exist but aren’t recommended.
Which Git Version Should I Download?
Always download the latest stable release from git-scm.com. Choose 64-bit for modern systems. The website auto-detects your operating system and recommends the correct installer package.
How Do I Update Git to a Newer Version?
Windows users download the new installer from git-scm.com. macOS with Homebrew runs brew upgrade git. Ubuntu and Debian use sudo apt update && sudo apt upgrade git.
Can I Install Git Without an Internet Connection?
Yes. Download the installer on another machine with internet access. Transfer the file via USB drive. Run the offline installer normally. Package managers like APT and Homebrew require connectivity.
Do I Need to Install Git to Use GitHub Desktop?
No. GitHub Desktop bundles Git internally. But learning the command line interface gives you more control. Most Git workflows in professional teams use terminal commands.
How Much Disk Space Does Git Require?
The Git installation uses approximately 300 MB. Your repositories add more depending on project size and history. Large binary files increase storage significantly. Consider gitignore rules to exclude unnecessary files.
Why Does Git Ask for My Username and Email?
Git attaches author information to every commit. This identifies who made each change in the project history. Teams use this data for code review and tracking contributions across the codebase.
Conclusion
You now know how to install Git on any major operating system. The process takes minutes, but the tool will serve you for years.
Git handles everything from solo projects to enterprise-scale code collaboration. Your local repository syncs with remote platforms. Your commit history tracks every change.
Start with basic commands like git add, git status, and git push. Build from there.
Branch management, merge conflicts, rebasing. These come later. Right now, your developer tools are ready.
Open your terminal. Run git init` in a project folder. Make your first commit.
That’s where real learning begins.



