git - 强制部分 git 挑选?

标签 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

最佳答案

也许您正在搜索gitcherry-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 .

关于git - 强制部分 git 挑选?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57903463/

相关文章:

git - 如何在 merge 操作中恢复某个特定文件的 'Resolve Conflict'?

git - 将 Git 与 ClearCase、AccuRev 或 Perforce 一起使用的值(value)?

svn - 哪个版本控制工具最适合处理反射 merge 或循环 merge ? SVN, git ?

Git Cherry-pick 与 merge 工作流

git cherry-pick 并通过忽略 EOL 更改进行 merge

git - 哪些 Git 分支模型适合您?

git - Sourcetree 中的标记消息在哪里

用于 merge 冲突的 Git 钩子(Hook)

git - 试图从功能分支 : No "cherries"? 中挑选

git - 为什么 cherry-pick pick 更改不止一次提交?