When you try to set rules on Github repositories to prevent any unsafe pushes to the key branches make sure to specify the Branch targeting criteria .
In one of my projects, when I accidently set it to All branches it did not even let me push to my own brnach.

It had to be later modifed like below to fix this error.
