Disable `git push –force` locally

I would like to disable git’s --force flag usage on local machine completely (globally for all the repos I have). I assume it’s possible with some bash hook, but where can I read more info about creating one?
Ideally the behavior would be like this: every time I try to use --force flag in any push command in any repository – my terminal will show the command abortion and tell me that it’s forbidden.


Source: bash

Leave a Reply