Gitflow
🌀Teammate Pushed While You Were RebasingHard+750 XP
Workshop
Scenario reference

Teammate Pushed While You Were Rebasing: the situation, step by step

The situation

Mid-rebase, your phone buzzes: a collaborator pushed 2 commits to the same feature branch. You're about to overwrite their work.

Finish your rebase, fetch their work, integrate before push. Force-with-lease will refuse.

Hard · 5 steps · +750 XP

What you will practice

This scenario walks through 5 steps, in order:

  1. 01Finish the rebase
  2. 02Fetch their new commits
  3. 03Try force-with-lease (will refuse safely)
  4. 04Pull with rebase to merge their changes
  5. 05Now safely force push
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. Finish the rebase
    git rebase --continue
  2. 2. Fetch their new commits
    git fetch origin
  3. 3. Try force-with-lease (will refuse safely)
    git push --force-with-lease
  4. 4. Pull with rebase to merge their changes
    git pull --rebase
  5. 5. Now safely force push
    git push --force-with-lease

Key takeaway

Communicate before rebasing shared branches. Pull-rebase loops handle the rest.