开发者

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜