Git Commit
One git commit
command can be seen as a sequence of git write-tree, git commit-tree, and git update-ref
.
$ git write-tree # record the contents of the index in a tree
0563f77d884e4f79ce95117e2d686d7d6e282887
$ echo "Initial commit" | git commit-tree 0563f77
5f1bc85745dcccce6121494fdd37658cb4ad441f
# Update ref pointed by HEAD
$ git update-ref refs/heads/head 5f1bc857