Gitflow
🚧Updates Were Rejected — Pull FirstEasy+300 XP
Workshop
Scenario reference

Updates Were Rejected — Pull First: the situation, step by step

The situation

You push and get: 'Updates were rejected because the remote contains work you do not have locally.' A teammate pushed while you were coding.

Pull (with rebase) first to integrate their work, then push.

Easy · 3 steps · +300 XP

What you will practice

This scenario walks through 3 steps, in order:

  1. 01Try the push — see it rejected
  2. 02Pull with rebase to integrate
  3. 03Push successfully
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. Try the push — see it rejected
    git push
  2. 2. Pull with rebase to integrate
    git pull --rebase
  3. 3. Push successfully
    git push

Key takeaway

Pull, resolve any conflicts, push. Never force-push to shared branches.