强制部分git cherry-pick?

force partial git cherry-pick?

当我在执行 git cherry-pick 时发生冲突,git 停止提交并允许我解决冲突。
有没有办法在没有冲突的情况下强制停止?
我想这样做的原因是我有一个更改,我想挑选,但我不想要它更改的所有文件。让它在提交之前停止允许我从提交中删除文件然后在没有它的情况下执行 git cherry-pick --continue

git cherry-pick --no-commit 做了一些与我想要的相似但不完全相同的事情。
如果您执行 git cherry-pick --no-commit 然后执行 git commit 结果与执行 git cherry-pick 时得到的结果不同,解决冲突然后执行 git cherry-pick --continue

这不是一个直接的答案,但您可以在成功选择无合并冲突后尝试进行软重置:

git reset --soft HEAD~1

这会将来自 cherry-pick 合并的更改集放入舞台,并且还会将您的工作目录与这些相同的更改同步。从那里,您可以四处寻找并进行所需的任何其他更改,然后重新提交。

我在这里假设您正在挑选单个提交。

也许您正在搜索 git cherry-pick --no-commit

-n --no-commit

Usually the command automatically creates a sequence of commits. This flag applies the changes necessary to cherry-pick each named commit to your working tree and the index, without making any commit. In addition, when this option is used, your index does not have to match the HEAD commit. The cherry-pick is done against the beginning state of your index.

This is useful when cherry-picking more than one commits' effect to your index in a row.

来自 here.