如何将分支合并到github中的master中? [英] How do I merge a branch into a master in github?

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

问题描述

我创建了一个repo和github,并将文件推送到其中.然后让一位同事创建一个分支并进行更改.我想将分支合并为master.

I created a repo and github, and pushed my files to it. Then had a colleague create a branch and make changes. I want to merge the branch to master.

我应该采取什么步骤?

推荐答案

请执行以下命令以与master合并, 假设您位于分支testBranch中,并且想要将更改与master

Please do following set of commands in order to merge with the master, Assuming that you are in branch testBranch and you want to merge the changes with the master,

首次结帐到master分支

git checkout master

现在拉出master中的最新更改,

Now pull the latest changes in master,

git pull origin master

testBranch

git merge testBranch

将更改推送到master

git push origin master

就这样,您完成了.

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

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