Keentune
Git, oriented
12 chapters
·
about 15 min read
·
free
Git stores snapshots, not changes. Almost every command that confuses people makes sense once that lands: a commit is a complete picture of your files, a branch is a sticky note pointing at one, and history is those pictures linked by parentage. The commands are a thin layer over that model, which is why memorising commands produces someone who is stuck the moment a situation differs from the recipe. Read this for the model. Once you can say where a change lives — working tree, index, or a commit — the right command is usually obvious.
Each chapter opens with the short version. Tap one to read the detail.
What a repository actually stores
~2 min
Git is a content-addressed store. A file's contents become a blob named by the hash of those contents, a tree records a directory, and a commit points at one tree plus its parents. Branches and tags are just names pointing into that graph.
The three trees, and why add catches people out
~2 min
A change lives in one of three places: the working tree, the index (what your next commit will contain), or a commit. git add copies the file as it is at that moment — edit it again and you must add it again.
Making commits
~2 min
A commit records a snapshot plus who made it and when, taken from your configured identity. --amend does not edit a commit — it replaces it with a new one, which matters the moment the original has been pushed.
Naming commits, and reading history
~2 min
Almost every command takes a revision, and the two operators people mix up are ~ and ^. Ranges matter just as much: A..B asks what is in B and not A, which is the question you usually mean.
Branches are pointers, which is why they are free
~2 min
A branch is a file containing one commit hash. Creating and deleting them costs nothing, so branch often. -d refuses to delete unmerged work; -D does it anyway.
Merging, and what a conflict actually is
~2 min
If your branch has not diverged, a merge is just a pointer move — a fast-forward, with no merge commit. If both sides changed, Git makes a commit with two parents. A conflict means Git will not guess, not that something broke.
Rewriting history, and the one rule about it
~2 min
Rebase replays your commits onto a new base, producing new commits with new hashes. That is why the rule is absolute: do not rebase anything others have already based work on.
Undoing, and why almost nothing is really lost
~2 min
reset moves your branch pointer; how much it drags along depends on the flag. Only --hard touches your files, and it is the one that can lose work. The reflog remembers where your branch used to point, which makes most mistakes recoverable.
Remotes: fetching, pulling and pushing
~2 min
fetch downloads and updates origin/main without touching your branch or your files. pull is fetch plus a merge or rebase. Understanding that split explains most confusion about being behind or diverged.
Ignoring files, and stashing work in progress
~2 min
.gitignore only prevents *untracked* files from being added — it has no effect on a file Git is already tracking, which is the single most common surprise. Stash parks uncommitted work when you need a clean tree.
Collaborating without stepping on each other
~2 min
Nearly every workable team convention is the same shape: short-lived topic branches off a shared integration branch, merged back when done. The failure modes are long-lived branches and rewriting anything already shared.
Finding the commit that broke it
~2 min
Bisect binary-searches history for the commit that introduced a problem. Mark one bad commit and one good one, and it halves the range each step — a few hundred commits becomes a handful of checks.
See the full Git curriculum
Written by Keentune. We are not affiliated with or endorsed by the organizations whose documentation informs this guide, and any linked sources belong to their respective owners.
All exam, test, and product names and trademarks are the property of their respective owners and are used here for identification and reference only. Keentune is independent study practice — not affiliated with, authorized, or endorsed by any of these organizations.
© 2026 SportaApp LLC