在Git上删除远程分支时出现拒绝错误

4
尝试删除远程分支时,我遇到了以下错误:

$ git push work :18300-018_5
remote: Processing changes: refs: 1, done
! [remote rejected] 18300-018_5 (can not delete references)
error: failed to push some refs  [...]

这是什么意思?
2个回答

6

这看起来像是一个 Gerrit 的回答,就像在function parseDelete()中所示。

  private void parseDelete(final ReceiveCommand cmd) {
    RefControl ctl = projectControl.controlForRef(cmd.getRefName());
    if (ctl.canDelete()) {
      // Let the core receive process handle it
    } else {
      reject(cmd, "can not delete references");
    }
  }

这是指向由Gerrit控制的推送策略的链接。

该类别控制用户在Gerrit中允许上传新提交的方式。
拒绝删除现有分支。这是最安全的模式,因为提交无法被丢弃。

因此,除非您在此Gerrit类别上激活“强制选项”,否则您将无法在该服务器上删除分支。


0
这是什么样的服务器?我猜不是GitHub,而是一个定制的服务器,专门配置为禁止分支删除。与您的系统管理员讨论此问题。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接