path: root/Documentation/tutorial.txt
diff options
authorJunio C Hamano <>2005-10-13 18:57:05 (GMT)
committerJunio C Hamano <>2005-10-13 18:57:05 (GMT)
commit5990efb0c4f6d1a19c4702bf50ef8cc5ac902a78 (patch)
treec4a2e571a330c415bcc3c00b637c4b9970ccc310 /Documentation/tutorial.txt
parent2ae6c706749b44f05917fcd04037f545d16fb345 (diff)
tutorial: update the initial commit example.
Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'Documentation/tutorial.txt')
1 files changed, 8 insertions, 6 deletions
diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt
index 00f4bab..6ecb089 100644
--- a/Documentation/tutorial.txt
+++ b/Documentation/tutorial.txt
@@ -293,14 +293,16 @@ also wants to get a commit message
on its standard input, and it will write out the resulting object name for the
commit to its standard output.
-And this is where we create the `.git/refs/heads/master` file. This file is
-supposed to contain the reference to the top-of-tree, and since that's
-exactly what `git-commit-tree` spits out, we can do this all with a simple
-shell pipeline:
+And this is where we create the `.git/refs/heads/master` file
+which is pointed at by `HEAD`. This file is supposed to contain
+the reference to the top-of-tree of the master branch, and since
+that's exactly what `git-commit-tree` spits out, we can do this
+all with a sequence of simple shell commands:
-echo "Initial commit" | \
- git-commit-tree $(git-write-tree) > .git/refs/heads/master
+commit=$(echo 'Initial commit' | git-commit-tree $tree)
+git-update-ref HEAD $(commit)
which will say: