What is a commit?
A commit is a saved snapshot of your project in Git, with a message explaining what changed and why.
Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?
A commit is one saved point in the history of a Git project. It records exactly what every tracked file looked like at that moment, who saved it, when, and a short message. Think of it as a labelled save slot in a video game: you can always return to it, compare it with others, or branch off from it.
You create commits dozens of times a day while coding: fix a bug, commit; add a feature, commit. Each commit has a long hexadecimal ID (the hash) such as a1b2c3d. Good commits are small and have clear messages, because teammates and your future self will read them in git log to understand how the project evolved.
git add .
git commit -m "Fix typo in login page"
See also: What is a branch? and What is a pull request?
Did this work for you?
No votes yet. Be the first.
If it did not work, the report form below tells the editors what went wrong.
See also
- 0034 Merging vs rebasing in Git Merge and rebase both bring commits from one branch into another. Merge keeps history exactly as it happened; rebase replays your commits… Intermediate · Explains an idea · Any system Article Branching & rebasing 15 Oct 2026
- 0041 Fix: CONFLICT (content): Merge conflict in … Two branches changed the same lines and Git cannot choose for you. Open the file, keep the right text, remove the markers,… Intermediate · Fixes an error · Any system Article Branching & rebasing · Common errors 15 Oct 2026
- 0262 Make your first pull request: Git and GitHub from first commit to merged change A complete beginner's path through Git and GitHub: set up Git, make commits, ignore files, use branches, push to GitHub, open a… Beginner · Guided project · Any system Article Branching & rebasing · Pull requests · Setup 15 Oct 2026
- 0270 What is a branch? A branch is a separate line of work in Git, so you can try changes without touching the main version of the… Beginner · Explains an idea · Any system Article Branching & rebasing 15 Oct 2026
- 0271 What is a merge conflict? A merge conflict happens when two branches changed the same lines and Git needs a human to decide which version wins. Beginner · Explains an idea · Any system Article Branching & rebasing 15 Oct 2026
History
Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.
- Dominik +740 chars