Zum Inhalt der Seite gehen


I need one of the git masters here.

git pull
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.

Already up to date.

How can I solve this? I do not need to keep any local changes, except for config files and .htaccess or so.
The message showed up after I did checkout "develop".

#Friendica !Friendica Support

Als Antwort auf utzer [Friendica]

Uhm, the message does tell you that you can "can squelch this message by running one of the following commands sometime before your next pull" - So pick your favorite (the first one is the default behavior, I would recommend that) of the three and don't be bothered by that message anymore. ;-)
Als Antwort auf elrido

@elrido hmm yes, I know it tells me to run one of the commands, but "man git" was not particularly helpful with "Reapply commits on top of another base tip." for what "rebase" does.
I am just using git to keep that folder up to date, therefor I do "git pull" once in a while. So I'll try a rebase.
Als Antwort auf utzer [Friendica]

I agree - In your case the "git reset --hard", to get rid of any local changes, is the simplest way to move on the way you intend to with the "git pull".

The configuration just needs to be set once to get rid of that message in the future - in older git versions it just silently used the default behaviour (merge). You want none of these three things to happen, as you didn't commit anything, as far as I understand. But you need to pick one to get rid of the message.

In case you would like to look up why git suddenly thinks something may need to be merged, you can check for any files that it thinks were changed using "git status" and look at the details using "git diff".

Reg. differences between merge and rebase, see for example git-scm.com/book/de/v2/Git-Bra… with it's illustrations. I know, neither is what you want to happen.

Als Antwort auf elrido

@elrido haha, after "git reset --hard develop" I still get the same message. I guess I have to look into it a bit deeper.
Als Antwort auf utzer [Friendica]

The message will not go away until you have selected one of the options with the git config command. The "git reset" will not remove the message - it just reverts any changes so the pull is guaranteed not to try and merge or rebase.

Except of course if you have committed things on the develop branch after all, then you will need to deal with a merge or rebase since your local branch would have diverged from the upstream develop branch.