Reputation: 775
I am trying to mirror a GitLab repo to a GitHub repo but it's getting rejected. I tried the following command:
git push --mirror https://github.***.com/***/***.git
I have admin access and still getting the following error:
remote: error: GH003: Sorry, force-pushing to master is not allowed.
To https://github.***.com/***/***.git
! [remote rejected] master -> master (pre-receive hook declined)
! [remote rejected] develop -> develop (pre-receive hook declined)
Upvotes: 0
Views: 1019
Reputation: 13923
The error message basically tells you what is wrong. You can not force-push to master because the branch is protected and the authenticated user is not allowed to override this protection.
It looks like you are using GitHub Enterprise. By default, users with admin permissions are not subject to protected branch rules. However, there is a setting, that will apply these rules to administrators as well. It is likely, that you need to deactivate it temporarily. See the documentation for more details.
Upvotes: 3