mirror of
https://github.com/git-for-windows/git.git
synced 2025-12-13 00:06:03 -06:00
Documentation: rev-parse: add a few "--verify" and "--default" examples
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
c3170a83d6
commit
824b5dc29c
@ -378,6 +378,31 @@ C? option C with an optional argument"
|
|||||||
eval `echo "$OPTS_SPEC" | git-rev-parse --parseopt -- "$@" || echo exit $?`
|
eval `echo "$OPTS_SPEC" | git-rev-parse --parseopt -- "$@" || echo exit $?`
|
||||||
------------
|
------------
|
||||||
|
|
||||||
|
EXAMPLES
|
||||||
|
--------
|
||||||
|
|
||||||
|
* Print the object name of the current commit:
|
||||||
|
+
|
||||||
|
------------
|
||||||
|
$ git rev-parse --verify HEAD
|
||||||
|
------------
|
||||||
|
|
||||||
|
* Print the commit object name from the revision in the $REV shell variable:
|
||||||
|
+
|
||||||
|
------------
|
||||||
|
$ git rev-parse --verify $REV
|
||||||
|
------------
|
||||||
|
+
|
||||||
|
This will error out if $REV is empty or not a valid revision.
|
||||||
|
|
||||||
|
* Same as above:
|
||||||
|
+
|
||||||
|
------------
|
||||||
|
$ git rev-parse --default master --verify $REV
|
||||||
|
------------
|
||||||
|
+
|
||||||
|
but if $REV is empty, the commit object name from master will be printed.
|
||||||
|
|
||||||
|
|
||||||
Author
|
Author
|
||||||
------
|
------
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user