Definition
What it is
A commit is not a diff. It is a snapshot: the complete state of every tracked file at that moment. The diff is computed on demand, by comparing the commit to its parent. That distinction matters: a commit can be checked out, signed, referenced by hash, and shared with a remote, all without reference to how it was built.
Each commit has:
- A hash (SHA-1 for older repos, SHA-256 for newer ones) that uniquely identifies it.
- A parent commit (or two, for a merge, or zero, for the first commit).
- A tree object pointing to the directory structure at that moment.
- An author (name, email, timestamp) and a committer (same shape, sometimes different).
- A message that explains why the change was made.
Why it matters
The hash is a promise of immutability. If someone gives you a1b2c3d, you can be sure that the content behind it has not changed — because if it had, the hash would be different. That single property enables git bisect (binary search for the commit that introduced a bug), git blame (who wrote this line), git log -S (when was this string introduced), and every reproducibility guarantee the ecosystem relies on.
The commit object
graph TD C[Commit a1b2c3d] --> T[Tree] C --> P[Parent commit] C --> A[Author + committer] T --> F1[blob: file1.php] T --> F2[blob: file2.php] T --> F3[blob: file3.php] style C fill:#E8F5E9 style P fill:#FFF3E0
Good commit vs bad commit
Aspect | Good commit | Bad commit |
|---|---|---|
Scope | One change | Three unrelated changes |
Message | Explains why | Explains what (redundant with the diff) |
Message length | 50 char subject, wrapped body | "fix stuff" |
Revertability | Can be reverted alone | Requires a manual surgical revert |
Reviewability | 200 lines | 5,000 lines |
Timeline
2005-04-03 — Linus Torvalds starts Git after BitKeeper's license change.
2005-04-07 — First self-hosting: Git commits its own repository.
2005-04-18 — The "commit" concept is stable: snapshot, hash, parent.
2005-07-11 — Git 1.0 rc1 ships.
2008-02 — GitHub launches, making commits a social artifact.
2020-02 — Git 2.25 ships SHA-256 commit hashing as experimental.
Writing a commit message
A commit message that survives time
Subject: 50 chars, imperative
"Add retry logic to Stripe webhook" — not "Added" nor "Adding".
Blank line, then body
The body explains why: the motivation, the previous behaviour, the new behaviour, edge cases.
Wrap at 72 chars
Email-era convention that still aids
git logreadability.Reference issues and PRs
"Fixes #42" auto-closes the issue when merged.
Sign when required
git commit -S(GPG) or-s(Developer Certificate of Origin). Do not skip unless the project allows it.
Common failures
Origin
The word comes from Latin: com- (together) + mittere (to send, to let go). In English, "to commit" means "to entrust" or "to bind oneself". Version control adopted it in the 1980s (via CVS and later Subversion) to name the act of committing one's changes to the shared repository — literally entrusting them to the team. Git in 2005 kept the verb and the noun.
A commit is a snapshot of your project at a specific point in time. Each commit contains a pointer to the snapshot, information about who made the changes and when, and a message that explains why the changes were made.
— Pro Git (Chacon & Straub), 2nd edition, 2014
Evidence
FAQ
- How many changes per commit?
One conceptual change. If the message has "and" twice, split it.
- Amend vs new commit?
Amend only before push. After push, amend rewrites history that others may have pulled.
- Commit vs push?
Commit is local. Push sends commits to a remote. You can commit fifty times without pushing once.
- Do I need a GPG signature?
Only if the project requires it. Git commits work unsigned by default.
Connections
Chacon, S. & Straub, B. (2014). Pro Git, 2nd ed. https://git-scm.com/book/en/v2
Git project (2024). git-commit(1). https://git-scm.com/docs/git-commit
Atlassian (2024). Git commit. https://www.atlassian.com/git/tutorials/saving-changes/git-commit
Etymology
Origin: borrowed
com(prefix): Latin, "together"mittere(verb): Latin, "to send, to let go"
Semantic network
● broader ● narrower ● related
Used in the garden
- Changelog (7×)
- Changelog · ENDURE (2×)
- The Neuroscience of Habit Formation for Peak Performance (2×)
- The Content Creator Who Branded Her Consistency (2×)
- Iteration Velocity: Why Shipping Daily Beats Monthly Perfection (2×)
- Security policy (1×)
- Brand Fundamentals: The Complete Guide to Building a Dominant Brand (1×)
- Marketing Outsourcing: When and How to Hire External Partners (1×)
- The Art of Deep Listening for Better Relationships (1×)
- The Silent Brand Strategy (1×)
- Digital Detox for Entrepreneurs: The Productivity Paradox (1×)
- The EdTech Founder's Guide to Selling to School Districts (1×)
- The Micronome: Scaling Your Micro‑Business Without Burning Out (1×)
- The Hidden Secret to Multiply Your Digital Wealth: Repeat and Continue (1×)
- The SEO Shortcut No One Tells You: Build Brand Authority, Win Google for Free (1×)
- Brand Consistency: Why Your Scattered Brand Is Costing You Trust (1×)
- The ,000 Branding Blunder: Validate Your SaaS Name Before Launch (1×)
- Unlock Wealth: The Secret Formula for Profitable Businesses That *Actually* Work (1×)
- The Growth Blindness: Why Your Business Is Stuck (And How Cash Visibility Unlocks It) (1×)
- The Homepage Blueprint: How to Optimize for Brand Impact and Conversion (1×)
- The Freelancer's Guide to Building a Personal Brand That Attracts Premium Clients (1×)
- Tired of the Routine? 10 Secret Web Apps to Unleash Your Beauty & Wellness (Smart Edition!) (1×)
- The Breath That Changes Everything: Science of Pranayama (1×)
- How to Attract High-Value Clients Without Relying on Referrals (1×)
- The Remote Worker's Tax Nightmare: Where Do You Pay Taxes in 2025? (1×)
- Brand Operating Systems for Independent Consultants (1×)
- Brand Crisis Management: How to Protect and Restore Your Reputation (1×)
- I Discovered My Competitor Was Using SEO While I Was Sleeping (1×)
- The Art of Networking for Introverted Entrepreneurs (1×)
- Unleash Hyper-Growth: Dominate Your LatAm Micro-Niche Under K MRR (1×)
- The Obsession That Keeps You Poor: Discover the Real Path to Sustainable Wealth (1×)
- The Secret Revealed: Proven Digital Businesses to Multiply Your Money (1×)
- The Art of Saying No to Protect Your Micro-Business (1×)
- Nudge Marketing: How Behavioral Economics Drives Conversions Without Manipulation (1×)
- Webinar Marketing: How Live Events Build Authority and Generate Quality Leads (1×)
- Branding vs. Marketing: The Essential Distinction Every Founder Must Grasp (1×)
- The Power of Stillness in a Chaotic World (1×)
- Brand Trust, Reputation, and Employer Branding: The Pillars of Credibility (1×)
Sources
Chacon, S. & Straub, B. (2014). Pro Git. https://git-scm.com/book/en/v2
Git project (2024). git-commit(1). https://git-scm.com/docs/git-commit
Atlassian (2024). Git commit. https://www.atlassian.com/git/tutorials/saving-changes/git-commit