根据我的理解,创建功能分支的优势之一是您可以轻松地看到大量提交已 merge 到开发分支中的位置。
完成功能分支后,建议删除功能分支,因为开发不再需要它。删除分支后,图形是否仍会被注释为“feature/my-fancy-feature”branching and merged?
最佳答案
"Upon finishing a feature branch the recommendation is to delete the feature branch since it is no longer needed for development."
“丢弃”和“merge ”特性分支的区别:
“完成”在这里是一个有歧义的表达。为确保我完全涵盖您的问题,我相信您指的是以下任一情况:
(1) 如果您希望丢弃 feature/my-fancy-feature
:
git branch -d feature/my-fancy-feature
(2) 如果您打算 merge 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?"
“快进 merge ”和“非快进 merge ”的区别
这取决于(结果不是 git-flow
依赖)。 git log
不会给你特定的分支名称(例如 feature/my-fancy-feature
)。它只会为您提供带有消息的提交历史记录。回顾快进 merge 和非快进 merge 之间的区别:
fast-forward-merge(feature/my-fancy-feature
中的所有提交历史将保留):
git merge
非快进 merge (feature/my-fancy-feature
中的所有提交历史都将消失):
git merge --no-ff
请引用 Vincent Driessen 的 article 中的以下插图:
更新
要在 SourceTree 中启用非快进功能,请检查从 Menubar-> SourceTree -> Preferences -> Git< 中找到的以下全局首选项选项
:
为了进一步解释,我从 SourceTree 的“帮助中心”找到了这段摘录:
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.
希望对您有所帮助!
关于git - 使用 GIT Flow 完成功能分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16403725/