Git - 如何将远程分支合并到远程主节点
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8972399/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git - How to merge a remote branch into remote master
提问by Greg
So here's the situation.
所以这里的情况。
I created a local branch. Then I pushed that local branch to github. So github now has two branches.
我创建了一个本地分支。然后我将该本地分支推送到 github。所以github现在有两个分支。
Now I want to merge the two branches together both locally and on github.
现在我想在本地和 github 上将两个分支合并在一起。
This is probably a dumb question but somehow I'm not seeing it in the documentation.
这可能是一个愚蠢的问题,但不知何故我没有在文档中看到它。
So far my best guess is to merge locally, and then delete the remote branch from github?
到目前为止我最好的猜测是在本地合并,然后从github中删除远程分支?
回答by Hiery Nomus
You create a merge of your feature branch locally, push the branch you merged to (probably "master") to github. Github will now contain the merge. Then delete your local and remote copy of the feature branch.
您在本地创建功能分支的合并,将您合并到的分支(可能是“master”)推送到 github。Github 现在将包含合并。然后删除功能分支的本地和远程副本。
回答by Mark Fisher
Just merge the branch locally into the master branch and push that to github's master branch.
只需将本地分支合并到 master 分支并将其推送到 github 的 master 分支。