← 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?
- A.It is faster
- B.It refuses if the remote branch has commits you have not fetched, so you can't overwrite them unknowingly
- C.It creates a backup branch automatically
- 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 →