DEV Community

Discussion on: Learn Git good practices!

Collapse
 
bloodgain profile image
Cliff • Edited

No, and in shared repositories I own, I disable the ability to force push. I call it the "No Jedi Rule".

The reason not to allow force push in the general case is that it allows someone to rewrite history. That should be discouraged. It is occasionally necessary to do, such as when something is added to a repo that could cause a security concern, but it should be fixed with the assistance of the repository owner or a designated administrator. Changing history will often invalidate downstream repositories, and allowing force push in general would allow these downstream repos to push the "bad" history back to the shared repo.