Creating new Commits

suggest change

The git commit command does a few things:

  1. Creates blob and tree objects for the index, stored in .git/objects
  2. Creates a commit object with your author information, commit message, and the root tree from step 1, also stored in .git/objects
  3. Points the current branch at that commit. .git/HEAD usually stays a symbolic ref such as ref: refs/heads/main. Only in detached HEAD does .git/HEAD itself 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.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents