What's changed: Expanded content (added diagrams)
1.2Core Git Concepts
The keys to understanding Git are repositories, commits, and branches—plus the three states a change passes through before it is recorded.
■ Repository, commit, branch
• Repository (repo) = the container holding a project’s files and its full history/metadata, physically stored in the hidden .git folder at the project root.
• Commit = a snapshot of changes at a point in time, identified by a unique hash (SHA) computed from its content, with author, date, and message. Commit in meaningful units with clear messages.
• Branch = a movable reference representing a parallel line of development. Branch a feature off a default branch like main, then merge it back when done. HEAD points to your current position.
■ The three stages before a change is recorded
Git manages changes in three stages: working tree → staging area (index) → repository (see the diagram).
• Working tree = the files you actually edit.
• Staging area (index) = where you place the changes to include in the next commit, added via git add.
• Repository = the state finalized by git commit and recorded in history.
Merely editing a file does not record it in history; you stage it and then commit to finalize. This extra step lets you select only related changes and group them into meaningful commits. Publish local commits to the remote with git push.
Sign in to track progress — Log in.
Quick check
(just a quick review)Q1. What uniquely identifies a commit?
Q2. What is the order of Git’s three stages?

