You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
E:\xxx>git push -f origin master
Password for 'http://xxx@git.xxx.cn':
Total 0 (delta 0), reused 0 (delta 0)
remote: GitLab: You are not allowed to force push code to a protected branch on this project.
To http://git.xxx.cn/xxx/xxx
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://xxx@git.xxx.cn/xxx/xxx.git'
"GitLab: You are not allowed to force push code to a protected branch on this project."
提示没有权限强制推送
强制推送命令
推送命令后出现了这样的情况
"GitLab: You are not allowed to force push code to a protected branch on this project."
提示没有权限强制推送
后来在网上进行一番搜索,发现了问题
就是这里,左边的意思是受保护的分支,受保护的分支不允许进行强制推送,解除掉受保护的分支即可,UnProtect解除保护,然后再次进行强制推送命令
$ git push -u origin master -f
。推完之后再回到这里进行重新保护master分支,选择分支,点击Protect即可
The text was updated successfully, but these errors were encountered: