For my repository, I am using Git and Stash. On the Stash end, I have restricted (read only) access to master, so that any user can branch off the master branch for feature/ branches but cannot merge to master directly unless its done via a Pull request.
But as a user, I can accidentally merge my feature branch to the master branch and attempt to push the master branch.
The good thing is that, the push isn't allowed and is restricted by Stash, but I was wondering if there was a way I could restrict the user to merge any branches to the master locally with the help of some hooks.
I was trying out pre-commit hooks, and they are great, I was wondering if there was something similar to it, such as pre-merge hooks.