简体   繁体   English

git 流功能合并的方向?

[英]Orientation of git flow feature merges?

In this answer the author talks about:这个答案中,作者谈到:

"You normally don't merge feature branches repeatedly into develop. You merge develop into the feature branches (ie the other way around) or rebase the feature branches onto the HEAD of develop (recommended)." “您通常不会将功能分支重复合并到开发中。您将开发合并到功能分支(即相反)或将功能分支重新定位到开发的 HEAD(推荐)。”

Now when I've done feature branch merges without git flow in the past I've always just switched my master branch and then run git merge <latest-feature-branch-commit> and that merges it back into master after merging any conflicts and committing.现在,当我过去在没有git flow的情况下完成功能分支合并时,我总是切换我的master分支,然后运行git merge <latest-feature-branch-commit>并在合并任何冲突后将其合并回主分支承诺。 So in git flow assuming the same is true with the develop branch acting as the master branch in this case (or at least that's how I've always thought of it, since you branch your feature/* branches off of it in git flow ), what does the author of that post mean about "you merge develop into feature branches"?因此,在git flow中,假设在这种情况下, develop分支作为master分支也是如此(或者至少我一直这么认为,因为您在git flow中分支了您的feature/*分支) ,那篇文章的作者所说的“你将开发合并到功能分支”是什么意思? Does he mean you should be in the feature/n branch and then merge develop from there?他的意思是你应该在feature/n分支中,然后从那里合并develop吗? That sounds a bit obsurd unless I'm missing something...这听起来有点荒谬,除非我错过了什么......

git rebase is opposite of git merge. git rebase与 git 合并相反。 in git rebase we take changes from master/develop branch and add them to feature branch, without creating any commit history.在 git rebase 中,我们从主/开发分支中获取更改并将它们添加到功能分支,而不创建任何提交历史记录。 git rebase also doing merge, but in opposite direction(main->feature). git rebase 也在做合并,但方向相反(主->功能)。 it may be sounding absurd to you but there are several advantages of using git rebase as listed here这对您来说可能听起来很荒谬,但使用 git rebase 有几个优点,如下所示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM