What is version control, and how does Git think?
What is version control, and how does Git think?
Imagine editing a project for several weeks and keeping copies named final, final2 and final-really. Version control replaces that fragile habit with an intentional history of meaningful checkpoints.
What you’ll learn
- Define repository, commit and branch.
- Explain Git's distributed model.
- Use a commit graph as a mental model.
From files to history
Working files
Edit the project in your normal folders.
current working treeCommit
Record an intentional project checkpoint.
snapshot + metadataHistory
Connect checkpoints through parent links.
A → B → C
Git stores snapshots and connects them into history
A repository is a project plus Git's history and metadata. A commit records a project state together with author information, a message and links to parent commit(s). Git identifies objects with hashes.
Git is distributed: a normal clone contains project history, so many history operations do not need a network connection. Branch names are movable references to commits; HEAD normally identifies the branch or commit you currently have checked out.
Create an empty repository
Run this in a disposable practice repository unless the lesson explicitly says otherwise.
mkdir git-course-demo
cd git-course-demo
git initgit init creates Git metadata for the current folder. Your ordinary project files remain ordinary files; the hidden .git directory stores the repository's local metadata and object database.
Practice: Version control and Git
Your task: Draw three commits as A → B → C. Add a branch name main pointing to C. Then imagine a second branch feature pointing to B. Explain that the branch names are labels pointing into the same commit graph.
Common pitfall to avoid
A commit is not simply a copied folder with a sequential version number. Git stores objects efficiently and identifies content cryptographically. For beginners, the useful mental model is still 'a saved project snapshot connected to previous snapshots.'
Check your understanding
Version control and Git: what to remember
What is version control, and how does Git think? is complete when you can explain the state being changed before you run the command, not merely repeat the syntax.
Read further: official supporting documentation.
Reaching the recap and completing the quizzes are separate milestones.