将本地分支合并到主分支以外的远程分支吗? [英] Merge local branch into remote branch other than master?
本文介绍了将本地分支合并到主分支以外的远程分支吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以我有一个远程分支中尚不存在的本地分支A.我在远程回购中有远程分支B.如何将本地更改合并到远程分支中?
so I have a local branch A that doesn't exist yet in remote repo. And I have remote branch B in remote repo. How do I merge my local changes into the remote branch?
请向我介绍一些链接.
推荐答案
如果分支B位于本地,则可以在本地将A合并到B并将B推送到远程:
If branch B is at local, You can merge A to B locally and push B to remote:
git checkout B
git merge A
git push origin B
如果本地没有B,则可以将A推到远程,并拉出将A合并到B的请求,然后单击github上的merge
按钮.
If you don't have B at local, you can push A to remote and pull request to merge A to B and click merge
button on github.
或者,将B分支提取到本地并将A合并到B,然后将B推送到远程,如下所示:
or, fetch B branch to local and merge A to B , then push B to remote, like this:
git checkout master
git fetch orign B:B (fetch B to local)
git checkout B (checkout to branch B)
git merge A (merge A to B)
git push origin B (push merged branch B to remote)
这篇关于将本地分支合并到主分支以外的远程分支吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文