即使我是项目所有者,GitLab也拒绝推动掌握 [英] GitLab refuses push to master even though I am the project owner
问题描述
运行以下内容:
- GitLab 8.15.0-rc1
- GitLab Shell 4.0.3
- GitLab Workhorse v1.1.1
- GitLab API v3
- Git 2.11.0
- Ruby 2.3.3p222
- 导轨4.2.7.1
- PostgreSQL 9.2.18
我已经在GitLab中创建了一个项目,并将我的代码毫无问题地推到了那里.我是项目负责人,在项目中扮演主"角色.
I have created a project inside GitLab and pushed my code onto there without problems. I am the Project Owner and have the role 'Master' with the project.
默认情况下,分支主"设置为受保护分支",仅允许角色为主"的组成员合并并推送到该分支.
Branch 'master' is set as a 'protected branch' by default, allowing only group members with role 'Master' to merge and push to that branch.
现在,我直接在master中进行了一些小的更改,这些更改不需要单独的分支.
Now I made some small changes directly in master that didn't warrant a separate branch.
但是,当我提交并推送这些更改时,出现以下错误:
However, when I commit and push these changes, I get the following error:
D:\Projects\MyProject>git push
Counting objects: 8, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (8/8), 731 bytes | 0 bytes/s, done.
Total 8 (delta 7), reused 0 (delta 0)
remote: GitLab: You are not allowed to force push code to a protected branch on this project.
To https://git.****.**/*****/****.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.****.**/*****/****.git'
不确定我在做什么错.我不是Git的专家,但这被认为是推力"吗?由于所有用户(包括具有主"角色的用户)均阻止了该操作.如果是这样,我应该如何更改master分支?
Not sure what I am doing wrong. I am not an expert on Git, but is this considered a 'force push'? Since that is blocked by all users, including those with role 'master'. If so, how should I be doing changes to the master branch?
它必须与受保护的分支"有关.如果删除它,我可以按一下.但是,由于受保护的分支"还可以防止删除分支及其历史,因此我希望将其保留在原位.
It must have something to do with the 'protected branch'. If I remove that, I can push just fine. However, since the 'protected branch' also prevents deleting of the branch and its history, I would like to keep that in place.
推荐答案
根据GitLab问题跟踪器,这是已知与Git 2.11和最新GitLab版本的不兼容.
According to the GitLab issue tracker this is a known incompatibility with Git 2.11 and latest GitLab versions.
https://gitlab.com/gitlab-org/gitlab-ce/issues/25301
从源代码暂时降级到Git 2.10应该可以解决此问题,直到在以后的GitLab版本中建立对Git 2.11+的适当支持为止.
Downgrading temporarily to Git 2.10 from source should fix the issue until proper support for Git 2.11+ is built in a future release of GitLab.
这篇关于即使我是项目所有者,GitLab也拒绝推动掌握的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!