Thread (11 messages) flat view 11 messages, 4 authors, 2021-07-23

RE: pull.rebase config vs. --ff-only on command line

From: Felipe Contreras <hidden>
Date: 2021-07-16 16:39:14

Hello Matthias,

Matthias Baumgarten wrote:
this is my first time contacting you guys and girls so I hope this mail 
achieves the expected standard. I've discovered the following behaviour 
of git:

If pull.rebase is configured to true and git pull --ff-only is executed 
it seems like the config wins, i.e. issuing "Successfully rebased and 
updated refs/heads/...", which is not what I would expect. I always 
believed that command line options would overwrite configured options.

Is my assumption that command line options always win wrong or is this a 
bug?
Yes, your assumption is correct, but the equivalent of that combination
is:

  git pull --rebase --ff-only

But --ff-only is only meant for the merge mode of `git pull`
(git pull --merge), not the rebase mode, so it's ignored. You can see
that from the documentation [1]:

  With --ff-only, resolve the merge as a fast-forward when possible.
  When not possible, refuse to merge and exit with a non-zero status.

Note the *merge* part.

[1] https://git-scm.com/docs/git-pull

-- 
Felipe Contreras
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help