git push失败'不修改你没有做的合并'当推向gerrit时

时间:2017-07-06 16:28:30

标签: git gerrit

我目前正在从gitlab迁移到gerrit,并且我正在尝试将最初从github克隆的repo移动到gitlab,然后它有多次提交。

我尝试使用的过程是:

git clone <gitlab repo>
cd <repo>
git remote add new-origin <newly created gerrit project>
git push new-origin

除了一个之外,这适用于所有的回购。这给了我以下内容:

$ git push new-origin
Counting objects: 2292, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (819/819), done.
Writing objects: 100% (2292/2292), 188.26 KiB | 0 bytes/s, done.
Total 2292 (delta 1142), reused 2287 (delta 1138)
remote: Resolving deltas: 100% (1142/1142)
remote: Processing changes: refs: 1, done
To <newly created gerrit project>
 ! [remote rejected] production -> production (do not amend merges not made by you)
error: failed to push some refs to '<newly created gerrit project>'`

如果我在从github克隆的原始repo上尝试相同的操作,它的工作没有问题。

任何人都可以告诉我这条消息的含义以及如何解决这个问题。

这是Gerrit代码,但我不清楚它反对的是什么:

public List<CommitValidationMessage> onCommitReceived(
    CommitReceivedEvent receiveEvent) throws CommitValidationException {
  final PersonIdent author = receiveEvent.commit.getAuthorIdent();
  if (receiveEvent.commit.getParentCount() > 1
      && author.getName().equals(gerritIdent.getName())
      && author.getEmailAddress().equals(gerritIdent.getEmailAddress())
      && !refControl.canForgeGerritServerIdentity()) {
    throw new CommitValidationException("do not amend merges not made by you");
  }
  return Collections.<CommitValidationMessage>emptyList();
} 

1 个答案:

答案 0 :(得分:1)

我收到了同样的错误消息。就我而言,我的Gerrit服务器的管理员必须授予我Forge Author和Forge Server权限才能成功推送。