]> git.ipfire.org Git - thirdparty/git.git/blobdiff - Documentation/git-show-ref.txt
builtin/show-ref: add new mode to check for reference existence
[thirdparty/git.git] / Documentation / git-show-ref.txt
index 9afcd4d536d0f48695fc0459cbad7271256c1791..ba7574700593e85ea65ac2e0e8516f286d11dcc8 100644 (file)
@@ -15,6 +15,7 @@ SYNOPSIS
             [-s | --hash[=<n>]] [--abbrev[=<n>]]
             [--] [<ref>...]
 'git show-ref' --exclude-existing[=<pattern>]
+'git show-ref' --exists <ref>
 
 DESCRIPTION
 -----------
@@ -30,6 +31,10 @@ The `--exclude-existing` form is a filter that does the inverse. It reads
 refs from stdin, one ref per line, and shows those that don't exist in
 the local repository.
 
+The `--exists` form can be used to check for the existence of a single
+references. This form does not verify whether the reference resolves to an
+actual object.
+
 Use of this utility is encouraged in favor of directly accessing files under
 the `.git` directory.
 
@@ -65,6 +70,12 @@ OPTIONS
        Aside from returning an error code of 1, it will also print an error
        message if `--quiet` was not specified.
 
+--exists::
+
+       Check whether the given reference exists. Returns an exit code of 0 if
+       it does, 2 if it is missing, and 1 in case looking up the reference
+       failed with an error other than the reference being missing.
+
 --abbrev[=<n>]::
 
        Abbreviate the object name.  When using `--hash`, you do