git version
Setup & Creating Projects
Show the installed Git version
The 'git version' command (or git --version) prints the version of Git installed on your computer. Options and behaviours change between releases, so check it when a tutorial does not work as described. Every option page on this site shows the first Git version that has that option.
Synopsis
git version [--build-options]
git --version[ ] optional| or<arg> placeholder... repeatable--flag option
Options
Choosing the Right Option
Ways to ask
All print the same version
| Command | Form |
|---|---|
git version | The command |
git --version | The usual option form |
git -v | The short form |
Examples
Show the version
git --versionFor example: git version 2.48.1.
Build details
git version --build-optionsPlatform and compile options (for bug reports).
Workflow Examples
1
git --versionNote the version
2
git bugreportCollect the rest
Troubleshooting
Old version on Linux or macOS
Cause: The system package is outdated
Install from git-scm.com or your package manager’s newer channel
Tips & Pitfalls
Best Practices
- ✓Keep Git reasonably up to date: new versions bring safer defaults and fixes.
Common Mistakes
- ✗Following a tutorial for a newer Git and getting "unknown option" errors — check your version first.
FAQ
A:
Download the installer from git-scm.com, or use your package manager (brew upgrade git, winget upgrade Git.Git…).