Is there a way to make a local branch immutable?
I'm extremely stupid and sometimes I merge a "feature branch" in the wrong master branch as opposed to the develop branch and that of course leads to pain and suffering. Since it's the second time already that this has been happening, I wonder if there's a way for me to make a branch immutable locally. I've already tried with this pre-commit hook to prevent me from directly making commits on said branch, but this is not stopping merges as in: git checkout master git merge wip Is there a way to prevent all possible changes to a local branch? If not, is it at least possible to prevent changes