Glossary · Programming

Git Commit

A Git commit is a saved snapshot of your project's tracked files, identified by a unique hash and stored with an author, timestamp and message.

Updated October 6, 2026

A Git commit is a recorded snapshot of the staged files in a repository. Each commit has a unique SHA hash, an author, a timestamp, a message and a pointer to its parent commit, forming the project history.

Why it matters

Commits are the units of history you review, revert and search. A good one is small, focused and explained: when something breaks months later, git log and git blame show what changed and why. Because commits are chained by hash, history cannot be silently altered without changing the IDs that follow.

Example

$ git add cart.js
$ git commit -m "Round cart total to two decimals"
[main 3f2a9c1] Round cart total to two decimals
 1 file changed, 2 insertions(+), 1 deletion(-)

The short ID 3f2a9c1 can later be used to inspect it with git show 3f2a9c1 or undo it with git revert 3f2a9c1.

Common mistakes

  • Writing vague messages such as "fix stuff" that tell future readers nothing.
  • Bundling unrelated changes into one commit, which makes it hard to revert one of them.
  • Rewriting commits that others have already pulled.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.