Creating new Commits
suggest changeThe git commit command does a few things:
- Creates
blobandtreeobjects for the index, stored in.git/objects - Creates a
commitobject with your author information, commit message, and the roottreefrom step 1, also stored in.git/objects - Points the current branch at that commit.
.git/HEADusually stays a symbolic ref such asref: refs/heads/main. Only in detached HEAD does.git/HEADitself store the new commit hash
This results in a new snapshot of your project being added to git that is connected to the previous state.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents