如何做一个GitHub“合并分支”? [英] How to do a GitHub "merge branch"?

查看:1171
本文介绍了如何做一个GitHub“合并分支”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在 Github 上创建一个主( master )项目时

  https://github.com/MyUser/MyProject 

以及 MyProject / branches 中列出的一些活动但非默认的分支,并使用URL

  https://github.com/MyUser/MyProject/tree/MyBranchName 

如何合并(与Github接口) MyBranchName master



注意:如果真的很简单,只需一个命令,如何通过终端上的git命令来完成它?






结果在
https://github.com/MyUser/MyProject/compare/MyBranchName?expand=1
没有比较的东西。 ..没有更多的线索,没有更多的界面来创建合并或叉或...。

这只适用于分支兼容的情况,但也可以在命令行中说明。



使用存储库页面上的分支下拉菜单转到分支。一旦你在分支上,点击旁边的绿色拉请求图标。它会创建一个pull请求,将您的分支中的所有提交移动到您的主存储库中。



如果分支兼容,您现在应该可以单击合并。 p>

确保合并方向正确,查看提交历史记录!


When I have at Github a main (master) project

 https://github.com/MyUser/MyProject

and some active but non-default branch, listed in MyProject/branches, and with an URL like

 https://github.com/MyUser/MyProject/tree/MyBranchName

how to merge (with Github interface) MyBranchName to master?

NOTE: if really easy, only one command, how to do it by git command on terminal?


The result at https://github.com/MyUser/MyProject/compare/MyBranchName?expand=1 is "There isn't anything to compare"... No more clues, no more interface to create a "merge" or "fork" or "...".

解决方案

This only works if the branches are compatible, but that can be said as well from the command line.

Go to the branch using the branch drop down on the repository page. once you are on the branch, click the green pull request icon beside it. It will create a pull request to move all commits from your branch into your master repository.

If the branches are compatible, you should be now able to click merge.

Make sure the merge direction is right reviewing the commit history!

这篇关于如何做一个GitHub“合并分支”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆