]> git.ipfire.org Git - thirdparty/git.git/commitdiff
documentation: add documentation for 'git version'
authorMatthias Aßhauer <mha1993@live.de>
Tue, 14 Sep 2021 13:27:18 +0000 (13:27 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 14 Sep 2021 17:05:40 +0000 (10:05 -0700)
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 <mha1993@live.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-version.txt [new file with mode: 0644]
Documentation/git.txt

diff --git a/Documentation/git-version.txt b/Documentation/git-version.txt
new file mode 100644 (file)
index 0000000..80fa775
--- /dev/null
@@ -0,0 +1,28 @@
+git-version(1)
+==============
+
+NAME
+----
+git-version - Display version information about Git
+
+SYNOPSIS
+--------
+[verse]
+'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
+---
+Part of the linkgit:git[1] suite
index 6dd241ef83881d37e7b9db20ba6e1492d49ac36a..95fe6f31b4f08710715e6296e9eadb8a8ea82a5b 100644 (file)
@@ -41,6 +41,10 @@ OPTIONS
 -------
 --version::
        Prints the Git suite version that the 'git' program came from.
++
+This option is internaly converted to `git version ...` and accepts
+the same options as the linkgit:git-version[1] command. If `--help` is
+also given, it takes precedence over `--version`.
 
 --help::
        Prints the synopsis and a list of the most commonly used