“git pull”或“git merge”主人与发展部门之间 [英] "git pull" or "git merge" between master and development branches
问题描述
我有我的 master
分支和一个 develop
分支来进行一些更改。我需要将 master
中的更改合并到 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:
-
git pull origin master
到develop
branch -
git merge master
intodevelop code>分行
git pull origin master
intodevelop
branchgit merge master
intodevelop
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屋!