1.3.2. Commits: Snapshots of Change
💡 First Principle: A commit is a permanent, timestamped snapshot of your entire repository at one moment, paired with a message explaining what changed and a unique identifying hash. Because each commit is a full snapshot (not just a list of edits), Git can reconstruct the exact state of every file at any point in the project's history, instantly.
Making a commit is a purely local action — it updates the history stored in your own .git folder and nothing else. That local-first design is deliberate: it means you can commit as often as you like, experiment freely, and only decide when to publish (push) your history to GitHub once it's ready to share.
⚠️ Exam Trap: A commit is not the same thing as uploading a file to GitHub. Your commits stay entirely local until you run a push — right up until that point, a collaborator looking at the GitHub repository has no way of knowing they exist.
Reflection Question: You've made five commits locally but haven't pushed yet. If your collaborator opens the repository on GitHub right now, how many of your changes will they be able to see?