提交 824b5dc2 编写于 作者: C Christian Couder 提交者: Junio C Hamano

Documentation: rev-parse: add a few "--verify" and "--default" examples

Signed-off-by: NChristian Couder <chriscool@tuxfamily.org>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 c3170a83
......@@ -378,6 +378,31 @@ C? option C with an optional argument"
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
------
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册