git - 为什么 git-flow 快速转发我的功能分支 merge ?

标签 git git-flow

我开始使用和学习 git-flow。通过阅读本文https://jeffkreeftmeijer.com/git-flow/它声明每个功能分支 merge 都将使用 --no-ff 参数到 git merge 考虑到功能分支的目的,这很有意义。

问题是我在一个空的 repo 中测试 git-flow,我无法弄清楚为什么使用命令 git flow feature finish "feature-name" 从功能分支 merge > 始终使用快进。

我想不出为什么要快进功能分支的原因。我在这里遗漏了什么吗?

最佳答案

有一种情况,git-flow 确实没有使用 --no-ff:
Look at GitHub issue #100 comment from Vincent Driessen :

By design, git-flow uses the --no-ff option when merging  
in order to record that the commits belong together historically. 
However, when the feature branch contains only a single commit,
the extra merge commit does not add anything and only complicates 
the branch tree needlessly.
So for single-commit branches, fast-forward merges are being made 
as if the commit was done on develop directly.

应该是this line of code #315 :

if [ "$(git rev-list -n2 "$DEVELOP_BRANCH..$BRANCH" | wc -l)" -eq 1 ]; then
    git_do merge --ff "$BRANCH"

关于git - 为什么 git-flow 快速转发我的功能分支 merge ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55688222/

相关文章:

c++ - 在 Visual C++ 中使用 Git 进行自动版本控制

git - 远程拒绝删除 git 远程分支

git - Git 中的分支和 merge 最佳实践

git - QA 如何使用 Gitflow 工作流程中的功能分支一次测试多个功能?

git - 我应该在使用 git flow 完成功能后进行 git push 吗?

git - 引用 git 中的上一个/下一个提交?

git - 在 GitLab CI 下的 Docker Compose 中从 git 构建时出现 "error initializing submodules"

git - 如何解决 "remote: You (@user) must accept the Terms of Service in order to perform this action."问题?

git 工作流 + 预生产

Git 流程澄清 Hotfix 和 RC 是否存在?