如何将分支合并到master? [英] How to merge branch to master?

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

问题描述

我确实有一个进行了一些更改的本地分支,我想将它合并到远程 master.当我运行时:git merge master 我得到:

I do have a local branch with some changes, and I want to merge it to remote master. When I run: git merge master I get:

已经更新

但我仍然可以看到 master 不包含新的更改.

but I still can see that the master doesn't contain the new changes.

我检查了以下问题 Git 合并报告Already up-to-date"虽然有不同的 Ask,但一方面它似乎已经过时,另一方面,没有任何提示有帮助.

I checked the following issue Git merge reports "Already up-to-date" though there is a difference Ask, but it seems in one hand to be outdated, and on the other hand, none of the hints there were helpful.

有什么想法或提示吗?

推荐答案

如果你想将你的分支合并到远程master,请按照以下步骤操作:

If you want to merge your branch to master on remote, follow the below steps:

  1. 使用 git push origin br-1 将您的分支说br-1"推送到远程.
  2. 使用 git checkout master 切换到本地存储库上的 master 分支.
  3. 使用 git pull origin master 将本地 master 更新为远程 master.
  4. 使用 git merge br-1 将 br-1 合并到本地 master.这可能会给您带来需要解决的冲突,并在继续之前提交更改.
  5. 一旦提交了 br-1 到本地主机的合并,使用 git push origin master 将本地主机推送到远程主机.
  1. push your branch say 'br-1' to remote using git push origin br-1.
  2. switch to master branch on your local repository using git checkout master.
  3. update local master with remote master using git pull origin master.
  4. merge br-1 into local master using git merge br-1. This may give you conflicts which need to be resolved and changes committed before moving further.
  5. Once merge of br-1 to master on local is committed, push local master to remote master using git push origin master.

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

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