I am reading about git objects: blob, tree, commit, tag. In order to have a better understanding of how git works, I tried some low level command like write-tree and commit-tree.
mkdir test; cd test-->git init- I create a file and
git add file. I can see a blob and tree object are generated in.git/objects git write-treeto print the current treeIDgit commit-tree treeID -m "commit a tree"to commit this tree. After this operation, a commit object is generated and I can see it does contain author, date, etc. However, I can't check my commits usinggit log, the error is :fatal: bad default revision 'HEAD'.
After above operations, when I run git status, I see the file is still in the index waiting for commit. What is the use of commit-tree and what's the difference between commit-tree and `commit'?