Merge commit without parent
Let's say I have the following com开发者_如何学Pythonmits in my master:
master : ---A----B----C----D---E
Now I need to create new branch from commit A and include only changes in commit C
master : ---A----B----C----D---E
\
branch2 : \-------C
So I need to put in my branch2 commit C without B
How can I do that ?
Use cherry-pick
git checkout -b branch2 <shaSUM of A>
git cherry-pick <shaSUM of C>
精彩评论