Git
Keep Git's moving parts straight: commits, branches, merges, rebases, remotes, recovery, and the collaboration rules that prevent a small command from becoming a bad Friday.
65 concepts390 live tasks
Start practicing freeWhat's inside
Repository State & Object Model
The working tree, index, and HEAD are separate states
A commit records a complete snapshot, not a file diff
Blobs, trees, and commits describe content and history
Object IDs identify content by its hash
Refs are movable names for commits
HEAD usually points to a branch name
Detached HEAD checks out a commit without a branch
Reachability determines what Git can find and retain
Inspecting & Recording Changes
Status reports changes across Git's state boundaries
Different diff forms compare different snapshots
Staging curates the next commit independently of edits
Patch staging can split one file into coherent commits
Untracked and ignored files are different states
A commit message preserves intent that code cannot
Amend replaces the current tip commit
Fixup commits record a targeted correction for later autosquash
Branches & History Shape
A branch is a lightweight movable pointer
Divergence is commits unique to each branch
A fast-forward moves a branch without creating a merge commit
A merge commit joins two parent histories
Ancestor relationships answer what history contains
A merge base is the best common ancestor for integration
Revision ranges select commits by ancestry
Tags name important points in history
Merges, Rebases & Conflicts
A three-way merge combines two changes from a shared base
Resolving a merge conflict creates the intended combined result
Rebase replays commits onto a new base
A rebase conflict is resolved one replayed commit at a time
Ours and theirs depend on the operation in progress
Merge preserves existing history while rebase rewrites it
rerere can reuse a recorded conflict resolution
Abort returns an in-progress integration to its starting state
Remotes & Synchronization
A remote is a named connection to another repository
Remote-tracking branches are local records of remote refs
Fetch updates remote-tracking refs without changing your branch
Pull fetches and then integrates according to configuration
An upstream relationship defines a branch's default partner
Push asks a remote to update a ref
A non-fast-forward rejection protects commits you lack
Force with lease checks the remote ref you expected
Selective Change & History Editing
Cherry-pick applies one commit's change as a new commit
Revert adds a compensating commit instead of removing history
Interactive rebase edits a local series of commits
Squashing combines several commits into one replacement commit
Splitting a commit separates unrelated changes into new commits
Reordering commits can expose hidden dependencies
Range-diff compares two versions of a patch series
Published history is a coordination contract
Undo & Recovery
Restore changes a path in the working tree or index
Reset moves the current branch and can reset the index or working tree
Reset modes differ by which states they replace
Restore, reset, and revert solve different undo problems
The reflog records recent movements of local refs
A lost commit can often be recovered before pruning
Clean removes untracked paths, so preview first
Stash saves local changes for later reapplication
Repository Boundaries & Advanced Layouts
Gitignore controls untracked files, not tracked history
Ignore patterns have path scope and ordering rules
Gitattributes assigns Git behavior by path
Line ending normalization avoids cross-platform churn
Git hooks automate local lifecycle events
Commit signing proves control of a signing key, not code quality
Worktrees provide multiple checkouts from one repository
Sparse checkout limits which paths populate the working tree
A submodule records a specific commit of another repository

