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.
UPDATE: Unfortunately none of answers are correct because I don't need a repository-located hook. I need a hook on my local computer to prevent me from using --force flag when pushing to remote.