0

I have an updated git branch on my local machine. But when I attempt at merging in master:

git pull
git fetch origin
git pull origin master

I get an error demanding a rebase:

hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
...
fatal: Need to specify how to reconcile divergent branches. 

But on the GitHub website, the remote branch will merge automatically. So the remote branch is consistent with master (doesn't require rebasing), but the local branch (which should be identical) does.

Am I missing some update step?

Git config:

> git config -l

credential.helper=osxkeychain
init.defaultbranch=main
user.name=<Me>
user.email=<Email>
http.schannelcheckrevoke=false
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
core.hookspath=.husky
remote.origin.url=<RemoteUrl>
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.<*FeatureBranch*>.remote=origin
branch.<*FeatureBranch*>.merge=refs/heads/<*FeatureBranch*>

> git config --global -l
user.name=<Me>
user.email=<Email>
http.schannelcheckrevoke=false

> git config --local -l

core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
core.hookspath=.husky
remote.origin.url=<RemoteUrl>
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.<*FeatureBranch*>.remote=origin
branch.<*FeatureBranch*>.merge=refs/heads/<*FeatureBranch*>
torek
  • 448,244
  • 59
  • 642
  • 775
Ryan Cocuzzo
  • 3,109
  • 7
  • 35
  • 64
  • you probably have something busting you in the setup. What is the output of `git config --global` and `git config`? – eftshift0 Nov 09 '22 at 14:13
  • @eftshift0 Just updated the description – Ryan Cocuzzo Nov 09 '22 at 14:22
  • thanks for the missing `-l` :-) How about `--global`? – eftshift0 Nov 09 '22 at 14:23
  • as a side comment: do not mix git and github. They are different (even if related somewhat) things. That is `git config`, not `github config`. – eftshift0 Nov 09 '22 at 14:25
  • Just updated! @eftshift0 – Ryan Cocuzzo Nov 09 '22 at 14:42
  • I was hoping to see something about `ff` in there, but I do not.... so I am not sure what it is about.... however, take a look at this: https://github.com/desktop/desktop/issues/14431 – eftshift0 Nov 09 '22 at 14:55
  • @eftshift0 Thanks for the link! It pointed me to this [reply](https://github.com/desktop/desktop/issues/14431#issuecomment-1106634672) and `git config --global pull.ff true` worked! If you add an answer with that, I can mark as the resolving answer. – Ryan Cocuzzo Nov 09 '22 at 15:08
  • No, no worries.... I would think this is a duplicate. I am actually not sure _why_ you would see the error message in the first place.... nor how what you are configuring solves it (it looks pretty counterintuitive to me).... maybe one of the wise guys who roam around could help me see through it.... anyway, glad it worked. – eftshift0 Nov 09 '22 at 15:13
  • 1
    @eftshift0 I agree "true" looks counterintuitive by itself, until you see there is another option of "only". So `pull.ff true` means fast-forward if possible, otherwise merge. `pull.ff only` means only allow fast-forward, otherwise error. And the option of `pull.ff false` never fast-forwards, and is like `merge --no-ff`. – TTT Nov 09 '22 at 18:08
  • Note that what used to be a warning ("you really ought to configure this setting based on how you know your project works") has now become an error ("you *must* configure this setting based on how you know your project works"). – torek Nov 14 '22 at 06:36

0 Answers0