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

Click any option to expand

Beginner (1)

Also print how this Git was built: CPU, compiler, libraries.

When neededDetails for a bug report

Example

git version --build-options

Choosing the Right Option

Ways to ask

All print the same version

CommandForm
git versionThe command
git --versionThe usual option form
git -vThe short form

Examples

Show the version

git --version

For example: git version 2.48.1.


Build details

git version --build-options

Platform and compile options (for bug reports).

Workflow Examples

1
git --version

Note the version

2
git bugreport

Collect 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…).