“git pull”或“git merge”主人与发展部门之间 [英] "git pull" or "git merge" between master and development branches

查看:112
本文介绍了“git pull”或“git merge”主人与发展部门之间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的 master 分支和一个 develop 分支来进行一些更改。我需要将 master 中的更改合并到 develop 中,但最终会将 develop 转换为 master 。记住有两种不同的工作流程:

I have my master branch and a develop branch for working on a few changes. I need to merge changes from master into develop, but will eventually merge everything from develop into master. I have two different workflows in mind:


  1. git pull origin master develop branch

  2. git merge master into develop code>分行

  1. git pull origin master into develop branch
  2. git merge master into develop branch

这是做这件事的最好方法,为什么?

Which is the best way to do this, and why?

推荐答案

小心rebase。如果你与任何人共享你的开发分支,rebase可能会让事情变得混乱。 Rebase只适用于你自己的本地分支机构。

Be careful with rebase. If you're sharing your develop branch with anybody, rebase can make a mess of things. Rebase is good only for your own local branches.

经验法则,如果你将分支推到原点,不要使用rebase。相反,使用合并。

Rule of thumb, if you've pushed the branch to origin, don't use rebase. Instead, use merge.

这篇关于“git pull”或“git merge”主人与发展部门之间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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