Is it possible to disable do “push force”, which overwrite “master” trunk of repository?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: For the trunk "master" I can do "git reset hard" to an earlier commit and then "git push force", to rewrite it in the repository. And I lose part of the development, after this commit. But if for some branches it is not so critical, then for the trunk "master" is very critical. Is it possible to disable do "push force", which overwrite "master" trunk of repository, and how can I switch off it? 回答1: The only way to disable force push on a per branch basis that I've ever come across is with a pre-receive hook as shown at https:/