当前位置:   article > 正文

gerrit: same Change-Id in multiple changes_same change-id in multiple changes. squash the com

same change-id in multiple changes. squash the commits with the same change-

错误: same Change-Id in multiple changes

在进行gerrit 提交时,发生:same Change-Id in multiple changes

这种情况常常是,coder 发现第一次commit 有了问题,然后在本地解决好这个问题之后,进行 第二次的commit,然后,在cmmit msg 里写上 相同的changId(在最后一个段落)

然后无法push 到gerrit 的远程分支(比如 refs/for/your_branch)

gerrit 拒绝这个提交的原因是,如果两个commit 是相同的changeId, 那么gerrit 为了review 的简单,
会禁止两次commit,因为你的commit 2 必然依赖 commit 1. 而且gerrit 一直推崇 commit --amend 这种方式。

ref

https://gerrit-review.googlesource.com/Documentation/error-same-change-id-in-multiple-changes.html

note

how to solve:

git rebase -i HEAD~2

  pick ca45e12 one commit
  squash 13d3812 another commit

  [detached HEAD ab37207] squashed commit
   1 files changed, 3 insertions(+), 0 deletions(-)
  Successfully rebased and updated refs/heads/master.

  $ git log
  commit ab37207d33647685801dba36cb4fd51f3eb73507
  Author: John Doe <john.doe@example.com>
  Date:   Thu Dec 16 10:12:54 2010 +0100

      squashed commit

      Change-Id: I93478acac09965af91f03c82e55346214811ac79

  $ git push ssh://JohnDoe@host:29418/myProject HEAD:refs/for/master
  Counting objects: 5, done.
  Writing objects: 100% (3/3), 307 bytes, done.
  Total 3 (delta 0), reused 0 (delta 0)
  To ssh://JohnDoe@host:29418/myProject
   * [new branch]      HEAD -> refs/for/master
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24

但是执行了这个,发生: duplicate request

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/68217
推荐阅读
相关标签
  

闽ICP备14008679号