Bootstrap FreeKB - Git (Version Control) - Resolve "You have divergent branches and need to specify how to reconcile them"
Git (Version Control) - Resolve "You have divergent branches and need to specify how to reconcile them"

Updated:   |  Git (Version Control) articles

Let's say you are getting something like this.

]$ git pull origin master
From ssh://git.example.com:7999/foo/bar
 * branch              master     -> FETCH_HEAD
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:
hint:
hint:   git config pull.rebase false  # merge
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches.

 

Check out my article FreeKB - Git (Version Control) - Resolve merge conflict.

  • A fast-forward merge happens when the branch you're merging into hasn't had any new commits since the branch you're merging from diverged. In this case, Git simply moves the branch pointer forward, resulting in a linear history.
  • A merge creates a new commit that combines the changes from both branches. This results in a non-linear history, preserving the individual history of each branch.
  • A rebase rewrites the history of the branch you're merging from as if it had been branched from the target branch's latest commit. This results in a linear history, but it changes the commit history of the branch.



Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter d1241a in the box below so that we can be sure you are a human.