我正在尝试推送到存储库的主分支,但我失败了,因为它受到保护。
我尝试查看项目设置,但没有看到任何 protected 分支的选项。我能看到的唯一选择是成员(member)。
remote: GitLab: You are not allowed to push code to protected branches on this project.
To git@gitlab.ins.risk.regn.net:cmd/release.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@gitlab.ins.risk.regn.net:cmd/release.git'
我的仓库只有一个分支,目前还没有任何内容。
我确实看到了其他存储库的 protected 分支选项,但没有看到此特定存储库的 protected 分支选项。
这是一个新的存储库,没有任何内容,只有默认分支。
我拥有master
权限。
不幸的是,我无法以某种方式在这里上传图像。
请建议如何将代码推送到主分支。
最佳答案
2018年12月17日
1。 git push
:“错误:无法将一些引用推送到”
git push -f
:“远程拒绝”
2。该分支处于 protected 状态,无法强制运行。
Gitlab - 存储库 - 分支
3。暂时删除分支保护。
Gitlab - 设置 - 存储库 - protected 分支 - 取消保护
4。再次尝试推送
git push -f
5。可以添加保护
关于gitlab - 远程 : GitLab: You are not allowed to push code to protected branches on this project,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42073357/