将主分支合并到另一个分支,但不合并两个分支 [英] Merge commit from Master-branch to another branch, but not to merge two branches
本文介绍了将主分支合并到另一个分支,但不合并两个分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
现在,我希望将Master分支中的所有修订(所有提交)修改为'new_branch' 。但我不想将两个分支合并成一个,因为我的新功能还没有完全开发出来,我该怎么做?
将您的主分支合并到您的功能分支中。
git merge master new_branch
$ c $现在,master中的修复被应用于 new_branch
,并且您可以继续开发您的新功能 new_branch
。
- I have git repository with one master branch.
- I decided to develop new feature and I have created new branch 'new_branch'
- I have created some commits in 'new_branch", but I am not finished new feature yet
- I decided to fix some bug in master branch, so I switch to master branch, fix code and made commits.
Now, I want to have all fixes (all commits) from Master branch into 'new_branch'. But I don't want merge two branches into one, because my new feature is not fully developed yet. How can I do it ?
解决方案 Merge your master branch into your feature branch.
git merge master new_branch
Now, the fixes in master are applied to new_branch
, and you can continue developing your new feature on new_branch
.
这篇关于将主分支合并到另一个分支,但不合并两个分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文