Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2008-05-13 08:51:41 +0400
committerJunio C Hamano <gitster@pobox.com>2008-05-21 23:57:18 +0400
commit824b5dc29cfe4f58d052d2d9273b39d34bf018e0 (patch)
tree35b2fe64acfa3d0834c136a553a92ec2f4d92a31 /Documentation/git-rev-parse.txt
parentc3170a83d6fee30c5d10afe33d88867ba0b68218 (diff)
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>
Diffstat (limited to 'Documentation/git-rev-parse.txt')
-rw-r--r--Documentation/git-rev-parse.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt
index b6b2fe92a1..69599ffb67 100644
--- a/Documentation/git-rev-parse.txt
+++ b/Documentation/git-rev-parse.txt
@@ -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
------