Commit
A saved snapshot of your project's files at a specific point in time. It permanently records changes made to the codebase along with a descriptive message.
What it is
A commit represents a specific state of your repository's history. When you commit, Git stores a snapshot of your staged changes, authorship metadata, and a pointer to the parent commit(s). It serves as a discrete, rollback-capable unit of work.
When you would use it
You create a commit after finishing a logical unit of work, ensuring your progress is safely recorded before moving on to the next task.
Common operations
- Saving a completed feature or bug fix.
- Reverting a codebase to a previous stable state.
- Reviewing the history of changes to a specific file.