为什么git的樱桃选择多次提交失败?

Why does git's cherry picking with more than one commit fail?

我试图合并两个回购,产生一个单位(又名交织)的历史。我按照https://stackoverflow.com/a/14839653/188108中的"历史重写:"行进行此操作。

要合并的两个分支位于"master"和"src/master"中。然后,我写道:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$ git checkout --orphan new-master
$ git cherry-pick 9d325d6d 3f4c52ba
error: a cherry-pick or revert is already in progress
hint: try"git cherry-pick (--continue | --quit | --abort)"
fatal: cherry-pick failed
$ git cherry-pick 9d325d6d && git cherry-pick 3f4c52ba
[new-master 10f0277] Initial revision.
 7 files changed, 194 insertions(+)
 create mode 100644 __init__.py
 create mode 100644 manage.py
 create mode 100644 samples/__init__.py
 create mode 100644 samples/models.py
 create mode 100644 samples/views.py
 create mode 100644 settings.py
 create mode 100644 urls.py
[new-master 08e083c] Fixed field name in SixChambersLayer.  Added Sample.current_place.
 1 file changed, 2 insertions(+), 1 deletion(-)

那么,为什么第一个cherry-pick命令失败了,但是split命令有效?我使用Git 1.9.1。


试试看:

1
git cherry-pick 9d325d6d^..3f4c52ba

正如我在"如何挑选一系列提交并合并到另一个分支"中提到的:

In the"cherry-pick A..B" form, A should be older than B.
If they're the wrong order the command will silently fail.

If you want to pick the range B through D (inclusive) that would be B^..D.