我有这个:
branch-1 a--b--c--d我需要这个:
branch-1 a--c--d
branch-2 b我试过这个:
$git checkout -b branch-2
$git cherry-pick <SHA-1 b>但我得到了这个:
error: could not apply <SHA-1 b>... [comment]
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'所以我做了$git status并得到了Unmerged paths ... both modified: .gitignore。我在再次尝试之前git added和git committed,只是再次得到相同的错误消息。
如何将特定的提交移动到新的分支上?
发布于 2012-11-20 03:10:24
当您提交合并时,就完成了对branch-2的挑剔。您不应该再次运行cherry-pick。选择不会改变branch-1的历史,所以你需要使用交互式的rebase来做这件事。
https://stackoverflow.com/questions/13460332
复制相似问题