Deep, practical guide to Git rebase, merge, fast-forward, cherry-pick, and history rewriting with workflows, safety tips, and production-grade examples.
1 · Git History & Mental ModelCommits, parents, and the DAGMerge vs rebase at a high levelVisualizing the commit graph for a small project2 · Merge Strategies & Fast-forward BehaviorFast-forward mergesMerge commits and --no-ffScripted example of fast-forward and no-FF merges3 · Rebase Deep DiveBasic and interactive rebaseRebase conflicts and safetyInteractive rebase with autosquash for a feature branch4 · Cherry-pick & Selective History EditingSelective commit applicationBackporting & failure recoveryBackporting a hotfix to a release branch with cherry-pick5 · History Rewriting & RecoveryAmend, squash, and filterReflog and disaster recoveryCleaning up history and recovering from a bad reset6 · Team Workflows & Best PracticesChoosing rebase vs merge in teamsCode review and CI integrationSample Git configuration and policies for a linear main branchFAQ — Common QuestionsIs it ever safe to rebase a branch that has already been pushed?What’s the difference between git pull and git pull --rebase?How do I undo a bad rebase or reset?When should I use cherry-pick instead of merge?Does squashing commits lose important history?How do merge strategies affect git bisect performance?How can I practice Git history rewriting safely?
Help us improve this article
Tell us if something is off, request coverage, or share feedback.