🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Rebase vs Merge and Clean History: all 15 questions

Quiz: Rebase vs Merge and Clean History · Question 6 of 15

Why is git push --force-with-lease safer than git push --force?

Why is git push --force-with-lease safer than git push --force?

  1. A.It is faster
  2. B.It refuses if the remote branch has commits you have not fetched, so you can't overwrite them unknowingly
  3. C.It creates a backup branch automatically
  4. D.It only works on main
Answer & explanation

Correct answer: It refuses if the remote branch has commits you have not fetched, so you can't overwrite them unknowingly

The "lease" is your last known remote state; if someone changed it, the push stops.

Can you get the rest right without peeking?

Take the timed Quiz: Rebase vs Merge and Clean History quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →