Git · Senior · Question 56 of 76
Why is git push --force to a shared branch dangerous even with backups on CI?
- 1It disables branch protection on the remote permanently
- 2It deletes all of the tags stored on the remote
- ✓Correct answer: Others' new commits vanish and may be lost
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.