尝试删除远程分支时出现以下错误:
$ 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 [...]
知道这是什么意思吗?
最佳答案
这看起来像是 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");
}
}
这是指向 push policy controlled by Gerrit 的链接.
This category controls how users are allowed to upload new commits to projects in Gerrit.
Deletion of existing branches is rejected. This is the safest mode as commits cannot be discarded.
因此,除非您在此 Gerrit 类别上激活“强制选项”,否则您将无法删除该服务器上的分支。
关于git - 在 git 上删除远程分支时被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12191481/