summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2ae6c70)
raw | patch | inline | side by side (parent: 2ae6c70)
author | Junio C Hamano <junkio@cox.net> | |
Thu, 13 Oct 2005 18:57:05 +0000 (11:57 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 13 Oct 2005 18:57:05 +0000 (11:57 -0700) |
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/tutorial.txt | patch | blob | history |
index 00f4bab954f9d40000593bdfa04145ca5504b680..6ecb089c5cc4cf8dcaa8005c0ee6e4208bced346 100644 (file)
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
+tree=$(git-write-tree)
+commit=$(echo 'Initial commit' | git-commit-tree $tree)
+git-update-ref HEAD $(commit)
------------------------------------------------
which will say: