[英]Move feature branch to another branch
We have a feature branch features/foo
created off master
that has not yet been merged.我们有一个功能分支
features/foo
从尚未合并的master
创建。
Recently we created a new dev
branch so that master
only contains releases.最近我们创建了一个新的
dev
分支,以便master
只包含发布。
I therefore need to move features/foo
onto dev
.因此,我需要将
features/foo
移到dev
。
Do I need to create a new branch from dev
for the feature and then push to that or is there a better way?我是否需要从
dev
为该功能创建一个新分支,然后推送到该分支,或者有更好的方法吗?
If you just want the changes that you checked into features/foo
to be applied to dev
and not any other changes that were checked into master
between the time dev
got branched off and your changes, you'd want to use如果您只想将您签入
features/foo
的更改应用于dev
而不是在dev
分支和您的更改之间签入master
任何其他更改,您会想要使用
git checkout features/foo
git rebase --onto dev master
Doing a straight git rebase [target-branch]
may include more changes than you want, depending on your exact branch history.直接执行
git rebase [target-branch]
可能包含比您想要的更多的更改,具体取决于您的确切分支历史记录。 Source: https://makandracards.com/makandra/10173-git-how-to-rebase-your-feature-branch-from-one-branch-to-another资料来源: https : //makandracards.com/makandra/10173-git-how-to-rebase-your-feature-branch-from-one-branch-to-another
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.