3

我得到以下信息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) 上的提交,仅此而已。

我发现一篇文章说我可以使用 git cherry-pick 将选定的提交移动到另一个分支并从另一个分支发送它以供审查。我不想通过另一个分支发送它以供审查,我想通过同一个分支发送它,因为它与特定功能有关。

我该如何解决这种情况?

4

2 回答 2

3

看来你有这样的事情:

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

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

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

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

于 2017-01-04T18:52:12.517 回答
2

One way you can do this is to use git rebase -i to reorder your commits so the one you want does not depend on any other commits that you don't want to submit.

于 2017-01-03T22:39:59.887 回答