Git · Senior · Question 56 of 76

Why is git push --force to a shared branch dangerous even with backups on CI?

Explanation

Commits pushed by others after your last fetch disappear from the branch; they exist only in their local reflogs. Use --force-with-lease and protect shared branches.

Further reading

Problem with a question

Git · Senior · question 56

Test yourself

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

Take this quiz