Knowledge Maxxing
← Back to topic library
Dev MaxxingBeginnerGit60 sec

Git commit

A Git commit is a saved snapshot of a project's files at a specific point, recorded with a message describing what changed.

Prerequisite: Git repository

What matters

Because each commit is a distinct, recoverable snapshot, a project's history can always be traced back or reverted to any earlier committed state.

Example

After fixing a bug, running 'git commit -m "Fix login error"' saves that exact state of the files as a new snapshot in history.

Common misconception

A commit is not the same as saving a file; saving changes a file on disk, while committing records that state permanently in the project's history.

Recall question

What does a commit capture that simply saving a file does not?

Keywords and related concepts

Git commitsnapshotversion historygit repository

Related topics

Git repository
Dev MaxxingBeginner
Git branch
Dev MaxxingBeginner