gpt4 book ai didi

git - 如何将 Gerrit 分支 merge 到另一个 Gerrit 分支

转载 作者:IT王子 更新时间:2023-10-29 00:56:21 29 4
gpt4 key购买 nike

我使用的是 Gerrit 2.4.2 版。我有一个分支 master,我创建了一个名为 newbranch 的新分支。然后我将一些更改推送到远程(Gerrit 的)newbranch。在 Gerrit 中验证后,我将更改 merge 到 newbranch

不,我想将 newbranch merge 到 master,发送更新 master(与 newbranch 的更改 merge >), 并删除 newbranch 分支。

我试过这样做:

git fetch
git checkout master
git merge newbranch
git push origin master:refs/for/master

但 Gerrit 返回此消息:

 ! [remote rejected] master -> refs/for/master (no new changes)

我该怎么办?

最佳答案

这种情况已被报告为 Gerrit 中的错误。这是来自 Gerrit's issue tracker 的解决方案/解决方法:

To the best of my knowledge, you have 2 options currently -

  1. Force push to refs/heads. It is just a fast-forward, so in theory everything has already been reviewed and verified. There is no point in doing so again, so just skip that process and push to refs/heads rather than refs/for.

  2. Go ahead and create a merge commit. Use 'git merge --no-ff' - this will create a merge commit even though it isn't necessary in your fast-forward situation. Then the merge commit can be uploaded, reviewed, verified, and merged like normal.

My company tends to go with option 2. I'll close this as wontfix, but if you have any suggestions on how to do this better please let us know.

关于git - 如何将 Gerrit 分支 merge 到另一个 Gerrit 分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12840279/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com