使用GIT Flow完成功能分支 [英] Finishing a feature branch with GIT Flow

查看:530
本文介绍了使用GIT Flow完成功能分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据我的理解,创建功能分支的优点之一是,您可以轻松查看大组提交已合并到开发分支中。



完成一个功能分支的建议是删除功能分支,因为它不再需要开发。一旦分支被删除,图表是否仍然被注解为feature / my-fancy-feature分支并合并?

解决方案

< blockquote>

完成一个功能分支后,建议删除
功能分支,因为它不再需要开发。




丢弃和合并特征分支之间的区别: b
$ b

Finishing是一个含糊不清的表达式。为了确保我完全覆盖了您的问题,我相信您的意思是以下任何一种情况:

(1)如果您希望丢弃 特性/ my-fancy-feature

  git branch -d feature / my-fancy-feature 

(2)如果您打算 merge 特性/ my-fancy-feature

  git flow feature完成my-fancy-feature 







一旦分支被删除,图表是否仍然被注解为
feature / my-fancy-featurebranches and merged?




快进合并与非快进合并之间的区别

这取决于(结果不是 git-flow dependent)。 git log 不会给你具体的分支名称(例如 feature / my-fancy-feature )。它只会给你提交消息的提交历史记录。回顾 fast-forward 合并和非fast-forward 合并之间的区别:

(code> feature / my-fancy-feature 中的所有提交历史将保留):

  git merge 

非快进-merge (在 feature / my-fancy-feature 中进行的所有提交历史记录都将消失):

  git merge --no-ff 

引用按照Vincent Driessen的文章的说明:




< h1>更新



要在SourceTree中启用非快进功能功能,请检查找到以下全局首选项选项从 Menubar-> SourceTree - >首选项 - > Git





有关详细解释,我从SourceTree的帮助中心中找到了这段摘录:


禁用
合并时的快进行为,这意味着无论接收分支中是否存在其他更改,显式合并提交总是创建

如果您希望在所有情况下都保留一个明确的分隔行
,那么这会很有用。


希望它有帮助!


From my understanding one of the advantages of creating feature branches is so that you can easily see where large groups of commits have been merged into the develop branch.

Upon finishing a feature branch the recommendation is to delete the feature branch since it is no longer needed for development. Once the branch has been deleted, will the graph still be annotated with "feature/my-fancy-feature" branched and merged?

解决方案

"Upon finishing a feature branch the recommendation is to delete the feature branch since it is no longer needed for development."

Difference between "discarding" and "merging" the feature branch:

"Finishing" is an ambiguous expression here. To make sure I fully cover your question, I believe you meant either one of the following cases:

(1) If you wish to discard the feature/my-fancy-feature:

git branch -d feature/my-fancy-feature

(2) If you meant to merge the feature/my-fancy-feature:

git flow feature finish my-fancy-feature


"Once the branch has been deleted, will the graph still be annotated with "feature/my-fancy-feature" branched and merged?"

Difference between "fast-forward-merge" and "non-fast-forward-merge"

It depends (the outcome is not git-flow dependent). git log won't give you the specific branch name (e.g. feature/my-fancy-feature). It will only give you the commit history with the message. Recalling the differences between fast-forward merging and non-fast-forward merging:

fast-forward-merge (all commit history made in feature/my-fancy-feature will remain):

git merge

non-fast-forward-merge (all commit history made in feature/my-fancy-feature will be gone):

git merge --no-ff

Refere to the following illustration from Vincent Driessen's article:

Update

To enable non-fast-forward feature in SourceTree, check the below global preference option found from Menubar-> SourceTree -> Preferences -> Git:

For further explanation, I found this excerpt from SourceTree's "Help Center":

disables fast-forward behaviour when merging, meaning that an explicit merge commit is always created regardless of whether there are other changes in the receiving branch. This can be useful if you want to maintain an explicitly separate line of development in all cases.

Hope it helped!

这篇关于使用GIT Flow完成功能分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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