A free, self-paced textbook in 8 chapters. Read a chapter, then drill it with the 105 companion flashcards using spaced repetition.
Git offers a spectrum of "undo" commands whose power increases from safe to destructive. The lightest touch is git reset --soft HEAD~1, which moves the HEAD pointer back one commit...
Untracked files are handled separately from modifications, and git clean is the dedicated tool for removing them. By default it removes untracked files; adding -d extends it to unt...
Interactive rebase is Git's primary tool for cleaning up commits before sharing them. Running git rebase -i HEAD~5 opens an editor listing the last five commits; you can reorder li...
Merging is Git's other way of combining work, and it offers several flags that change how branches are combined. The default git merge feature performs a fast-forward when possible...
git stash provides a way to set work aside without committing it, useful when you need a clean working tree to switch branches, pull, or bisect. git stash push -m 'message' saves t...
Branch housekeeping is mostly a matter of choosing the right safety flag. git branch -m new-name renames the current branch (use -M to force-overwrite an existing name). Deletion u...
Git's history tools answer different questions, and choosing the right one saves time. git log --oneline --graph --decorate --all renders the branch topology in the terminal so you...
For mistakes that have already entered shared history, rewriting tools are needed. To remove a committed secret, use git filter-repo or the BFG Repo-Cleaner to scrub it from every...