tutorial: update the initial commit example.

Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Junio C Hamano 2005-10-13 11:57:05 -07:00
parent 2ae6c70674
commit 5990efb0c4
1 changed files with 8 additions and 6 deletions

View File

@ -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 on its standard input, and it will write out the resulting object name for the
commit to its standard output. commit to its standard output.


And this is where we create the `.git/refs/heads/master` file. This file is And this is where we create the `.git/refs/heads/master` file
supposed to contain the reference to the top-of-tree, and since that's which is pointed at by `HEAD`. This file is supposed to contain
exactly what `git-commit-tree` spits out, we can do this all with a simple the reference to the top-of-tree of the master branch, and since
shell pipeline: that's exactly what `git-commit-tree` spits out, we can do this
all with a sequence of simple shell commands:


------------------------------------------------ ------------------------------------------------
echo "Initial commit" | \ tree=$(git-write-tree)
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: which will say: