情况如下:
DevC如何从AAA和BBB中选择更改来创建一个新的提交CCC?
注意事项:
ASCII图
CCC (should include GoodIdeaA and GoodIdeaB)
|
| BBB (added GoodIdeaB, in the process deleted GoodIdeaA)
| /
AAA (added GoodIdeaA)注意,BBB是通过批发copy-and-paste操作完成的。应该是通过合并完成的。
发布于 2014-09-18 21:39:12
如果希望获取提交的各个部分,可以使用git cherry-pick和-n选项来避免添加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.所以就像这样:
git cherry-pick -n AAA
git cherry-pick -n BBB
# Edit, clean up
git commit -m CCChttps://stackoverflow.com/questions/25922745
复制相似问题