Skip to content

Commit

Permalink
tutorial: update the initial commit example.
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Oct 13, 2005
1 parent 2ae6c70 commit 5990efb
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Documentation/tutorial.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
tree=$(git-write-tree)
commit=$(echo 'Initial commit' | git-commit-tree $tree)
git-update-ref HEAD $(commit)
------------------------------------------------

which will say:
Expand Down

0 comments on commit 5990efb

Please sign in to comment.