Git 审查 : submit particular commit from multiple commits

标签 git gerrit git-review

我在 git review 上得到以下内容:

git review
You are about to submit multiple commits. This is expected if you are
submitting a commit that is dependent on one or more in-review
commits. Otherwise you should consider squashing your changes into one
commit before submitting.

The outstanding commits are:

2de3eef (HEAD -> AddingReleaseIndex) Adding index page for subrelease projects
d3dbc89 (Addingindex) Add index with submodules

Do you really want to submit the above commits?
Type 'yes' to confirm, other to cancel: no
Aborting.

我有很多分支,每个分支都有一个正在实现的特定功能。我只想发送 HEAD (2de3eef) 上的提交以供审核,仅此而已。

我找到了一个 article它说我可以使用 git cherry-pick 将选定的提交移动到另一个分支并将其发送给另一个分支以供审查。我不想通过另一个分支发送它以供审查,我想通过同一个分支发送它,因为它是关于特定功能的。

我该如何解决这种情况?

最佳答案

看起来你有这样的东西:

.. ---A     <= master
       \
        B   <= feature1
         \
          C <= feature2

这样(基于提交 B 提交 C)如果您将提交 C 推送到 Gerrit,您也必然会推送提交 B。您需要按以下方式工作:

        B <= feature1
       /
.. ---A   <= master
       \
        C <= feature2

提交 C 必须基于提交 A。feature1 和 feature2 分支必须并行工作。

关于Git 审查 : submit particular commit from multiple commits,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41453454/

相关文章:

git - 如何使用 Intellij IDEA 进行交互式 rebase ?

Git 未推送所有文件

Git - 在 merge 时忽略文件但仍将其推送到远程

Gerrit & Phabricator 评论

ruby - 如何在同一个 EventMachine react 器中运行 Net::SSH 和 AMQP?

python - pip 连接失败 : cannot fetch index base URL http://pypi. python.org/simple/

git - 列出通过 git-review 下载的本地分支的关联 Gerrit 补丁集编号

Git status - 有没有办法只显示特定目录中的更改?

git - 为 Gerrit 及其所有 Git 存储库设置镜像的最佳方式

python - 在 macOS Sierra 上使用 git-review 的 RequestsDependencyWarning