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

und*_*oid 3 git git-flow

我开始使用和学习 git-flow。通过阅读这篇文章https://jeffkreeftmeijer.com/git-flow/,它指出每个功能分支合并都将使用 --no-ff 参数,考虑git merge到功能分支的目的,该参数是有意义的。

问题是我正在一个空的存储库中测试 git-flow,但我无法弄清楚为什么使用该命令从功能分支进行的合并git flow feature finish "feature-name"始终使用快速转发。

我无法想象为什么要快进功能分支的原因。我在这里错过了什么吗?

kap*_*siR 6

有一种情况确实git-flow没有使用--no-ff
查看来自 Vincent Driessen 的 GitHub 问题 #100 评论

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.
Run Code Online (Sandbox Code Playgroud)

应该是这行代码#315

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