即使我是项目所有者,GitLab 也拒绝推送到 master [英] GitLab refuses push to master even though I am the project owner

查看:35
本文介绍了即使我是项目所有者,GitLab 也拒绝推送到 master的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行以下:

  • 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
  • Rails 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.

分支'master'默认设置为'protected branch',只允许角色'Master'的组成员合并并推送到该分支.

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:ProjectsMyProject>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"的用户.如果是这样,我应该如何对 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 也拒绝推送到 master的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆