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

标签 git configuration merge command-line-arguments

我在本地 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/

相关文章:

仅当所有测试通过时 Git 主存储库更新,怎么办?

svn - 使用 git-svn 时避免冲突

macos - Homebrew 软件更新失败 : "Please, commit your changes or stash them before you can merge"

asp.net - 通用格式的最佳 PDF 转换器

hadoop - 如何在不使用getmerge的情况下将头文件作为第一行插入HDFS的数据文件中(复制到本地时性能问题)?

android - 合并两个 JSON 的更好方法

git - 更新文件夹中的所有 repo 协议(protocol)?

java - CORS 的 Spring 实现没有在我预期的时候拒绝消息

configuration - 从 F# 脚本使用 app.config

php - 是否可以在 php.ini 中使用环境变量?