git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jul 16, 2021, 16:39 UTC
Message-ID
<60f1b62c7531c_ade9208d8@natae.notmuch>
In-Reply-To
<c62933fb-96b2-99f5-7169-372f486f6e39@aixigo.com>
Hello Matthias,
Matthias Baumgarten wrote:
Show 11 quoted lines
> 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
Previous: Matthias Baumgarten
Message 11 of 11 in “pull.rebase config vs. --ff-only on command line”
  1. Matthias BaumgartenJul 16, 2021
  2. Elijah NewrenJul 16, 2021
  3. Felipe ContrerasJul 16, 2021
  4. Matthias BaumgartenJul 16, 2021
  5. Felipe ContrerasJul 16, 2021
  6. Matthias BaumgartenJul 19, 2021
  7. Felipe ContrerasJul 19, 2021
  8. Junio C HamanoJul 22, 2021
  9. Felipe ContrerasJul 22, 2021
  10. Matthias BaumgartenJul 23, 2021
  11. Felipe ContrerasJul 16, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.