Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find out what version of git I'm running?

Tags:

git

People also ask

How do I know if I have git installed on my PC?

How do I know if Git is installed? To see if Git is installed on your system, open your terminal and type git --version . If your terminal returns a Git version as an output, that confirms you have Git installed on your system. If not, you have to download Git for Mac or Windows.

How do I update my git version?

Download the installation file from the Git website. Run the installation and follow the install wizard to update Git to the latest version. Note: Using the install wizard to update Git overwrites the current installation.

What is git update command?

If you have already installed Git, you can update Git with the command. git update-git-for-windows. to know the current version, use: git --version.

What is the latest git version for Windows?

The current source code release is version 2.37.2. If you want the newer version, you can build it from the source code.


$ git --version
git version 1.7.3.4

git help and man git both hint at the available arguments you can pass to the command-line tool


If you're using the command-line tools, running git --version should give you the version number.


In a command prompt:

$ git --version

Or even just

git version

Results in something like

git version 1.8.3.msysgit.0


From Gareth's answer:

git help and man git both hint at the available arguments you can pass to the command-line tool

Actually, the git version command finally gets an official help page with Git 2.34 (Q4 2021):

See commit b6d8887 (14 Sep 2021) by Matthias Aßhauer (rimrul).
(Merged by Junio C Hamano -- gitster -- in commit 188da7d, 23 Sep 2021)

documentation: add documentation for 'git version'

Signed-off-by: Matthias Aßhauer

While 'git version'(man) is probably the least complex git command, it is a non-experimental user-facing builtin command.
As such it should have a help page.

Both git help(man) and git version can be called as options (--help/--version) that internally get converted to the corresponding command.
Add a small paragraph to Documentation/git.txt describing how these two options interact with each other and link to this help page for the sub-options that --version can take.
Well, currently there is only one sub-option, but that could potentially increase in future versions of Git.

git version now includes in its man page:

git-version(1)

NAME

git-version - Display version information about Git

SYNOPSIS

git version [--build-options]

DESCRIPTION

With no options given, the version of 'git' is printed on the standard output.

Note that git --version is identical to git version because the former is internally converted into the latter.

OPTIONS

--build-options

Include additional information about how git was built for diagnostic purposes.

git now includes in its man page:

This option is internally converted to git version ... and accepts the same options as the git version command.
If --help is also given, it takes precedence over --version.