Your branch and 'origin/master' have diverged. How to fix it?


git

Recently I got this message when run git status:

On branch master
Your branch and 'origin/master' have diverged,
and have 1 and 13 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)
nothing to commit, working tree clean

To fix this error just simply run git reset --hard origin. That’s it. If you run git status again the output will be the following:

On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
comments powered by Disqus