Manuals / Git & GitHub / Chapter 6

B · Collaborate · intermediate · Day 4–5 · Chapter 6 of 12

Rebase vs merge & history hygiene

Merge preserves branch topology. Rebase replays commits for linear history. Never rebase pushed shared branches without team agreement.

Path progress
44%

Step 1 of 3

Merge feature into main

git checkout main && git merge feature/x — creates merge commit if diverged.

Merge feature into mainDrag stickies · tap for tips
Study mapDrag stickies · tap for tipsKeep it shortdrag · tap →Name the waitdrag · tap →Scope locatorsdrag · tap →Trace when stuckdrag · tap →One browser firstdrag · tap →Isolate statedrag · tap →Assert the UIdrag · tap →Retry wiselydrag · tap →Seed datadrag · tap →Close the loopdrag · tap →Keep it shortdrag · tap →Name the waitdrag · tap →Scope locatorsdrag · tap →Trace when stuckdrag · tap →One browser firstdrag · tap →Isolate statedrag · tap →Pathwise hackdrag · tap →Merge feature intodrag · tap →Try thisdrag · tap →Follow the dashed drag · tap →

Do this now

Learn Git Branching: merge levels. Replay in git-practice.

Was this step clear?
Chapter learning outcomes
  • git merge
  • git rebase
  • Interactive rebase lite
  • When to use each

Clear these before you leave

Side quest

Linear history

Rebase feature onto main before PR; verify git log --oneline.