how to

need-to-specify-how-to-reconcile-divergent-branches-when-git-pull

Mar 28, 2024
softwares-and-toolsgitpull
1 Minutes
178 Words

Error message

1
! [rejected] main -> main (non-fast-forward)
2
error: failed to push some refs to 'github.com:julyfun/mfa.fish.git'
3
hint: Updates were rejected because the tip of your current branch is behind
4
hint: its remote counterpart. Integrate the remote changes (e.g.
5
hint: 'git pull ...') before pushing again.
6
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

or

1
hint: You have divergent branches and need to specify how to reconcile them.
2
hint: You can do so by running one of the following commands sometime before
3
hint: your next pull:
4
hint:
5
hint: git config pull.rebase false # merge (the default strategy)
6
hint: git config pull.rebase true # rebase
7
hint: git config pull.ff only # fast-forward only
8
hint:
9
hint: You can replace "git config" with "git config --global" to set a default
10
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
11
hint: or --ff-only on the command line to override the configured default per
12
hint: invocation.

First Check

Check if you have tried git pull.

Sol 1

Use github desktop, just pull and no problem occurs.

Sol 2

1
git config pull.rebase false

That’s what github desktop does.

Article title:need-to-specify-how-to-reconcile-divergent-branches-when-git-pull
Article author:Julyfun
Release time:Mar 28, 2024
Copyright 2025
Sitemap