Browse Source

git-rev-parse.txt: clarify --git-dir

The current behavior is often to print an absolute path rather than
a ../../etc string, but callers must be ready to accept a relative
path, too. The most common output is ".git" (from the toplevel of
an ordinary work tree).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Jonathan Nieder 14 years ago committed by Junio C Hamano
parent
commit
80d868b068
  1. 7
      Documentation/git-rev-parse.txt

7
Documentation/git-rev-parse.txt

@ -136,7 +136,12 @@ appending `/{asterisk}`. @@ -136,7 +136,12 @@ appending `/{asterisk}`.
directory (typically a sequence of "../", or an empty string).

--git-dir::
Show `$GIT_DIR` if defined else show the path to the .git directory.
Show `$GIT_DIR` if defined. Otherwise show the path to
the .git directory, relative to the current directory.
+
If `$GIT_DIR` is not defined and the current directory
is not detected to lie in a git repository or work tree
print a message to stderr and exit with nonzero status.

--is-inside-git-dir::
When the current working directory is below the repository

Loading…
Cancel
Save