summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2008-10-18 07:07:23 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-10-18 07:07:23 -0700
commitf4a75a416f62c0494e06cb42a11c7cc70ec9303e (patch)
treeb8318783753a6afd782d5447b8b4da8c02a670b3 /Documentation
parentMerge branch 'maint' (diff)
parenttutorial: update output of git commit (diff)
downloadtgif-f4a75a416f62c0494e06cb42a11c7cc70ec9303e.tar.xz
Merge branch 'pb/commit-where'
* pb/commit-where: tutorial: update output of git commit reformat informational commit message git commit: Reformat output somewhat builtin-commit.c: show on which branch a commit was added
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/gittutorial-2.txt15
1 files changed, 10 insertions, 5 deletions
diff --git a/Documentation/gittutorial-2.txt b/Documentation/gittutorial-2.txt
index 660904686c..bab0f34b45 100644
--- a/Documentation/gittutorial-2.txt
+++ b/Documentation/gittutorial-2.txt
@@ -32,22 +32,27 @@ Initialized empty Git repository in .git/
$ echo 'hello world' > file.txt
$ git add .
$ git commit -a -m "initial commit"
-Created initial commit 54196cc2703dc165cbd373a65a4dcf22d50ae7f7
+[master (root-commit)] created 54196cc: "initial commit"
+ 1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 file.txt
$ echo 'hello world!' >file.txt
$ git commit -a -m "add emphasis"
-Created commit c4d59f390b9cfd4318117afde11d601c1085f241
+[master] created c4d59f3: "add emphasis"
+ 1 files changed, 1 insertions(+), 1 deletions(-)
------------------------------------------------
-What are the 40 digits of hex that git responded to the commit with?
+What are the 7 digits of hex that git responded to the commit with?
We saw in part one of the tutorial that commits have names like this.
It turns out that every object in the git history is stored under
-such a 40-digit hex name. That name is the SHA1 hash of the object's
+a 40-digit hex name. That name is the SHA1 hash of the object's
contents; among other things, this ensures that git will never store
the same data twice (since identical data is given an identical SHA1
name), and that the contents of a git object will never change (since
-that would change the object's name as well).
+that would change the object's name as well). The 7 char hex strings
+here are simply the abbreviation of such 40 character long strings.
+Abbreviations can be used everywhere where the 40 character strings
+can be used, so long as they are unambiguous.
It is expected that the content of the commit object you created while
following the example above generates a different SHA1 hash than