git - 使用 GIT Flow 完成功能分支

标签 git version-control git-flow atlassian-sourcetree

根据我的理解,创建功能分支的优势之一是您可以轻松地看到大量提交已 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 中的以下插图:

enter image description here

更新

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

enter image description here

为了进一步解释,我从 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/

相关文章:

git - 使用 gitflow 和 gitversion 一次构建,多次部署

git - Jenkins GitSCM 在特定文件夹中 checkout

linux - 如何在 linux 中传入读取的 bash 变量并将其作为消息发送到 git commit 中?

git - 适用于许多小文件的最佳 git 类版本控制工具

git - 将 IP 地址 '140.82.113.4' 的 ECDSA 主机 key 永久添加到 Cpanel 中的已知主机列表中

svn - 在 svn 下保持两条非常接近但独立的开发线?

git - Visual Studio 不会撤消我的 git 更改

c++ - .cpp,v 扩展名的文件

git - 如何为 `git flow feature checkout` 别名创建补全?

git - 一个分支的多个功能 - 有什么意义?