I would like to protect my git repository so only non master branches can be overwritten. Is there a way to protect only selected branches?
If you would be allowed to modify your server, then this will enable fast-forwarding on server.
ssh ip 'echo $"[receive] denyDeletes = false denyNonFastForwards = false" >> /path/to/repo/config' #then git push -f origin master