Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why won't Git override my merge.ff setting from the command line?

I've set merge.ff to only in my local Git config:

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

This successfully prevents Git from performing a non-fast-forward merge, as expected.

However, when I want to explicitly allow such a merge and try to override that setting from the command line (either directly or as per this answer), I can't:

$ 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.

What am I missing?

like image 247
Paul Whittaker Avatar asked Sep 18 '25 21:09

Paul Whittaker


1 Answers

I probably found the solution of that problem. According to the release-notes of git 1.8.4 the cli was not working correctly:

* 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.
like image 87
Florian Neumann Avatar answered Sep 21 '25 20:09

Florian Neumann