In the project we have a main repo with master branch MAINREPO/master
(upstream). My team has a fork MYTEAM
(origin). We aggried that we use MYTEAM/master
only synchronize with MAINREPO/master
:
1. git checkout master
2. git fetch upstream
3. git rebase upstream/master
4. git push
But of course, somebody broke this rule and accidentally commited to MYTEAM/master
(origin/master). And now, 4. git push
fails. My first idea was to use git push origin master -f
but it seems that my remote forbids that:
remote: error: GH003: Sorry, force-pushing to master is not allowed. ! [remote rejected] master -> master (pre-receive hook declined)
I'm not and admin of my enterprise github so I guess I can do nothing about it? Anyway, how can I fix my origin master?