tutorial: update the initial commit example.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Oct 13, 2005 at 11:57 UTC
5990efb0c4f6d1a19c4702bf50ef8cc5ac902a78
1 file changed
+8
-6
Documentation/tutorial.txt
+8
-6
@@ -293,14 +293,16 @@ also wants to get a commit message
293
on its standard input, and it will write out the resulting object name for the
294
commit to its standard output.
295
296
-And this is where we create the `.git/refs/heads/master` file. This file is
297
-supposed to contain the reference to the top-of-tree, and since that's
298
-exactly what `git-commit-tree` spits out, we can do this all with a simple
299
-shell pipeline:
296
+And this is where we create the `.git/refs/heads/master` file
297
+which is pointed at by `HEAD`. This file is supposed to contain
298
+the reference to the top-of-tree of the master branch, and since
299
+that's exactly what `git-commit-tree` spits out, we can do this
300
+all with a sequence of simple shell commands:
301
302
------------------------------------------------
302
-echo "Initial commit" | \
303
- git-commit-tree $(git-write-tree) > .git/refs/heads/master
303
+tree=$(git-write-tree)
304
+commit=$(echo 'Initial commit' | git-commit-tree $tree)
305
+git-update-ref HEAD $(commit)
306
------------------------------------------------
307
308
which will say: