Bird
0
0

You rebased your feature branch onto main and now want to update the remote branch. What must you do to push your changes?

hard📝 Workflow Q15 of 15
Git - Rebasing
You rebased your feature branch onto main and now want to update the remote branch. What must you do to push your changes?
AUse <code>git push</code> normally without flags
BUse <code>git push --force</code> to overwrite remote history
CDelete the remote branch and push again
DUse <code>git push --no-verify</code> to skip hooks
Step-by-Step Solution
Solution:
  1. Step 1: Understand effect of rebase on commit history

    Rebase rewrites commit history, so remote branch history differs from local.
  2. Step 2: Identify correct push method after rebase

    You must force push with git push --force to update remote branch with rewritten history.
  3. Final Answer:

    Use git push --force to overwrite remote history -> Option B
  4. Quick Check:

    Rebase requires force push to update remote [OK]
Quick Trick: After rebase, always force push to update remote branch [OK]
Common Mistakes:
  • Trying normal push after rebase
  • Deleting remote branch unnecessarily
  • Using push flags unrelated to rebase

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes