Skip to content

Commit b6d8887

Browse files
rimrulgitster
authored andcommitted
documentation: add documentation for 'git version'
While 'git version' 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` 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. Signed-off-by: Matthias Aßhauer <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 225bc32 commit b6d8887

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

Documentation/git-version.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
git-version(1)
2+
==============
3+
4+
NAME
5+
----
6+
git-version - Display version information about Git
7+
8+
SYNOPSIS
9+
--------
10+
[verse]
11+
'git version' [--build-options]
12+
13+
DESCRIPTION
14+
-----------
15+
With no options given, the version of 'git' is printed on the standard output.
16+
17+
Note that `git --version` is identical to `git version` because the
18+
former is internally converted into the latter.
19+
20+
OPTIONS
21+
-------
22+
--build-options::
23+
Include additional information about how git was built for diagnostic
24+
purposes.
25+
26+
GIT
27+
---
28+
Part of the linkgit:git[1] suite

Documentation/git.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ OPTIONS
4141
-------
4242
--version::
4343
Prints the Git suite version that the 'git' program came from.
44+
+
45+
This option is internaly converted to `git version ...` and accepts
46+
the same options as the linkgit:git-version[1] command. If `--help` is
47+
also given, it takes precedence over `--version`.
4448

4549
--help::
4650
Prints the synopsis and a list of the most commonly used

0 commit comments

Comments
 (0)