Git config pull

After a recent update, git pull started printing

$ git pull                                                                                                                                                                                                                                                                       [6b8ccff5]
warning: Pulling without specifying how to reconcile divergent branches is
discouraged. You can squelch this message by running one of the following
commands sometime before your next pull:

  git config pull.rebase false  # merge (the default strategy)
  git config pull.rebase true   # rebase
  git config pull.ff only       # fast-forward only

You can replace "git config" with "git config --global" to set a default
preference for all repositories. You can also pass --rebase, --no-rebase,
or --ff-only on the command line to override the configured default per
invocation.

Which, if any, is the recommended configuration for Julia and the package ecosystem?

(Sorry if the question makes no sense. I tried reading up on this and found a lot of conflicting advice).

1 Like

I use pull.ff only. That way I don’t get the automatic, and I find annoying merges when pulling. Instead I have to be explicit about whether I want to merge or rebase. Often during package dev it is the latter. However, an automatic rebase I would find a bit dangerous.

3 Likes

I don’t think I’ve relied on git pull --rebase before the the warning message was added in version 2.27.

There have been some occasions where I accidentally get merges during pull, where pull --ff-only would have been more appropriate. Luckily, this doesn’t happen frequently to me and I find the default strategy to be sufficient.

(I’ve started to appreciate Oh Shit, Git!?! when the default strategy “fails”)

2 Likes