Git · Middle · Question 10 of 75

Why prefer git push --force-with-lease over --force?

Explanation

--force replaces the remote branch blindly, wiping a colleague's new commits. --force-with-lease checks that the remote is still where your last fetch saw it.

Further reading

Problem with a question

Git · Middle · question 10

Test yourself

Take the Git · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz