开发者

Merge commit without parent

开发者 https://www.devze.com 2023-04-12 19:30 出处:网络
Let\'s say I have the following com开发者_如何学Pythonmits in my master: master: ---A----B----C----D---E

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

精彩评论

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

关注公众号