That depends a bit on where your remote repository is. If you have full control over it, creating an update
hook would probably be the easiest solution. You would just check the branch name (ref name) with a list of allowed branches, and if it does not match, reject the update.
If you are using Gitolite for access control to your repository, you can also just specify the rules to apply only to known branches and disallow push access to all others.