我在本地 Git 配置中将 merge.ff
设置为 only
:
$ git config --list | grep merge
merge.ff=only
如预期的那样,这成功地阻止了 Git 执行非快进 merge 。
但是,当我想明确允许这样的 merge 并尝试从命令行覆盖该设置时(直接或按照 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.
我错过了什么?
最佳答案
我可能找到了那个问题的解决方案。根据release-notes of git 1.8.4 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.
关于git - 为什么 Git 不从命令行覆盖我的 merge.ff 设置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23543969/