Gitflow
🌀Rebase Hell — 12 BehindHard+700 XP
Workshop
Scenario reference

Rebase Hell — 12 Behind: the situation, step by step

The situation

Your `feature-dashboard` has 5 commits. Main moved 12 ahead from 4 developers. PR says 'Cannot merge'.

Alice, Bob, Charlie, Diana all pushed changes touching your files.

Hard · 6 steps · +700 XP

What you will practice

This scenario walks through 6 steps, in order:

  1. 01Fetch latest
  2. 02Rebase onto main
  3. 03Check conflicts
  4. 04Stage and continue
  5. 05Continue rebase
  6. 06Force push safely
Reveal the step-by-step commands

Try the terminal first — you learn more by doing. When you want to check yourself, here is the command for each step.

  1. 1. Fetch latest
    git fetch origin
  2. 2. Rebase onto main
    git rebase main
  3. 3. Check conflicts
    git status
  4. 4. Stage and continue
    git add .
  5. 5. Continue rebase
    git rebase --continue
  6. 6. Force push safely
    git push --force-with-lease

Key takeaway

Use --force-with-lease over --force — refuses if someone else pushed.