In a common (git-based) development workflow, one maintains a master branch and a next (or dev) branch which is used for testing purposes: 
- feature branches begin from 
masterand are merged intonextfor testing. If deemed stable, feature branches can be merged intomaster. masteris periodically merged intonextnextis periodically rewound (say, after a release).- The 
nextbranch should never be merged into themasterbranch 
It would be useful to be able to automatically prevent merges of next into master, either directly or via another branch based on next. How can one accomplish this using git?
Note: as described in this question, it is possible to use git hooks to prevent these types of merges on a remote repository one has full access to. However, this is (presumably) not possible with services like BitBucket or GitHub, so I seek a solution that works with a local repository, or one which can be used with a remote repository that one only has limited administrative access to.