When the commit
command is executed, a commit object gets created with the metadata of the content/changes that were added earlier using the git add
command. The metadata includes the following:
Then the created commit object gets linked to the tree object, which has already linked with the blob thus completing the versioning process as shown in the following figure:
Note that the head contains the branch name and not the SHA-1 ID of the commit that it is pointing to. This is because it becomes tough to identify a branch with its commit IDs when the volume and position of commits inside a branch keep changing, hence the statement "branch moves".
Now if you do a git status
you will see that the changes you staged are not in the staged changes state any longer.
18.119.172.146