Version control records every change to a set of files, who made it and why, so you can go back, compare, and work in parallel without overwriting each other. Today that almost always means Git. It is the safety net under every serious project, and the history it keeps is documentation.
Key concepts
- Commits as snapshots: each commit stores the state of the tree, a message and a link to its parent.
- Branches: cheap pointers to a line of work; you start one for each idea.
- Merging and rebasing: two ways to combine lines of work, one keeping the shape of history and one rewriting it.
- Remotes: other copies of the repository you push to and pull from; every clone holds the full history.
- Good history: small commits, each with one purpose and a message that says why.
Vocabulary
- Staging area: where you assemble the next commit.
- HEAD: the commit you are standing on.
- Conflict: two changes touch the same lines and a person must decide.
- Tag: a permanent name for one commit, such as a release.
What to study, in order
- Make a repository, commit, branch, merge, and read the log with its graph view.
- Cause a merge conflict on purpose and resolve it by hand.
- Learn the object model: blobs, trees, commits, and how a branch is just a pointer.
- Practise rebasing a private branch, and the rule never to rewrite history others have pulled.
- Recover from mistakes with the reflog, revert and bisect.