MW

How-To · Version Control

How to Check Git Version on Windows, Mac, and Linux — `git --version` (2026)

`git --version` is the universal Git health-check. Here's what to run, what to expect, and what to do when the output isn't what you wanted.

Jan 24, 2025 2 min read Any platform beginner
Advertisement

Checking Git version is the first step to verify Git is installed and determine which features are available. The command is the same on every OS:

Terminal — works on Windows / Mac / Linux
$ git --version
git version 2.42.0

This guide covers reading the output, locating Git on each OS, and updating when you need to.

Introduction

Why Check Git Version?

  • Verify Git is installed
  • Check feature availability
  • Ensure compatibility
  • Troubleshoot issues
  • Plan upgrades

Version Format: Git versions follow major.minor.patch format (e.g., 2.42.0)

Check Git Version

Basic Command

git --version

Output example: git version 2.42.0.windows.1

Detailed Information

git version

Same output as git --version.

All Platforms

Works the same on Windows, macOS, and Linux — the output format varies slightly:

Windows — Command Prompt / PowerShell
C:\> git --version
git version 2.42.0.windows.1
Linux — bash / zsh
$ git --version
git version 2.42.0

Version Information

Understanding Output

Standard Output:

git version 2.42.0

Windows Output:

git version 2.42.0.windows.1

Components:

  • 2: Major version
  • 42: Minor version
  • 0: Patch version
  • .windows.1: Platform-specific build (Windows)

Version Components

Major Version: Significant changes, may break compatibility Minor Version: New features, backward compatible Patch Version: Bug fixes, security updates

Check Git Capabilities

git --version --build-options

Shows build configuration and enabled features.

Verify Installation

Check if Git is Installed

git --version

If installed: Shows version number If not installed: Command not found error

Find Git Location

Windows:

where git

macOS/Linux:

which git

Common Locations:

  • Windows: C:\Program Files\Git\cmd\git.exe
  • macOS: /usr/local/bin/git or /usr/bin/git
  • Linux: /usr/bin/git

Verify Installation Path

Windows:

where git
git --exec-path

macOS/Linux:

which git
git --exec-path

Update Git

Windows

Using Git for Windows:

  1. Download latest from git-scm.com
  2. Run installer
  3. Verify: git --version

Using winget:

winget upgrade Git.Git

Using Chocolatey:

choco upgrade git

macOS

Using Homebrew:

brew upgrade git

Using Git Installer:

  1. Download from git-scm.com
  2. Run installer
  3. Verify: git --version

Linux

Ubuntu/Debian:

sudo apt update
sudo apt upgrade git

Fedora/RHEL:

sudo dnf upgrade git

Arch Linux:

sudo pacman -Syu git

Troubleshooting

Issue: git command not found

What 'not installed' looks like
C:\> git --version
'git' is not recognized as an internal or external command, operable program or batch file.

Windows:

  • Git not installed
  • Git not in PATH
  • Restart terminal after installation

macOS/Linux:

  • Git not installed
  • PATH not configured
  • Use package manager to install

Issue: Wrong version shown

Possible causes:

  • Multiple Git installations
  • PATH pointing to old version
  • Version manager (nvm, etc.) interfering

Solution: Check which Git is used:

which git
git --version

Issue: Version mismatch

Client vs Server:

  • Local Git version may differ from remote
  • Usually not an issue unless major version difference
  • Update to latest for best compatibility

Quick Reference

Check Version: git --version Find Location: which git (macOS/Linux) or where git (Windows) Update: Use platform-specific package manager Verify: Run git --version after installation/update

Conclusion

Checking Git version:

  1. Use git --version command
  2. Verify installation location
  3. Update if needed using package manager
  4. Understand version format for compatibility

Key Points:

  • git --version works on all platforms
  • Version format: major.minor.patch
  • Update regularly for security and features
  • Verify installation if command not found

Knowing your Git version helps ensure compatibility and access to latest features.

Git Version Command Line Installation Development
Advertisement

Get weekly notes in your inbox

Practical tips, tutorials and resources. No spam.