将提交推送到另一个分支 [英] Push commits to another branch
本文介绍了将提交推送到另一个分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以提交并将更改从一个分支推送到另一个分支。
假设我提交了 BRANCH1 中的更改并希望推送它们至 BRANCH2 。
从 BRANCH1 ,它有效:
git push origin ** BRANCH2 **
然后重置BRANCH1?
解决方案
<
git push origin当推送到非默认分支时,您需要指定源ref和目标ref: branch1:branch2
或者
git push< remote> <具有新更改的分支>:<您正在推送的分支>
Is it possible to commit and push changes from one branch to another.
Assume I commited changes in BRANCH1 and want to push them to BRANCH2.
From BRANCH1, is it valid to do:
git push origin **BRANCH2**
And then reset BRANCH1?
解决方案
That will almost work.
When pushing to a non-default branch, you need to specify the source ref and the target ref:
git push origin branch1:branch2
Or
git push <remote> <branch with new changes>:<branch you are pushing to>
这篇关于将提交推送到另一个分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文