为什么Git不会从命令行覆盖我的merge.ff设置?

时间:2014-05-08 13:59:37

标签: git configuration merge command-line-arguments

我已在本地Git配置中将merge.ff设置为only

$ git config --list | grep merge
merge.ff=only

这成功阻止了Git按预期执行非快进合并。

但是,当我想明确允许这样的合并并尝试从命令行覆盖该设置时(直接或按照this answer),我不能:

$ git merge --no-ff other-branch
fatal: You cannot combine --no-ff with --ff-only.
$ git -c merge.ff=false merge other-branch
fatal: You cannot combine --no-ff with --ff-only.
$ git -c merge.ff=true merge other-branch
fatal: Not possible to fast-forward, aborting.

我错过了什么?

1 个答案:

答案 0 :(得分:3)

我可能找到了那个问题的解决方案。根据{{​​3}},cli无法正常工作:

* The configuration variable "merge.ff" was cleary a tri-state to
  choose one from "favor fast-forward when possible", "always create
  a merge even when the history could fast-forward" and "do not
  create any merge, only update when the history fast-forwards", but
  the command line parser did not implement the usual convention of
  "last one wins, and command line overrides the configuration"
  correctly.