Wednesday 23 November 2016

Git Issue : Your branch and 'origin/master' have diverged - how to throw away local commits?

22:21:00 Posted by Kumanan ,
I have the following message in git:

# Your branch and 'origin/master' have diverged, 
# and have 3 and 8 different commits each, respectively. 
# (use "git pull" to merge the remote branch into yours) 

I would like to throw away the 3 local commits, and pull the 8 remote commits at origin/master.

git fetch origin 
git reset --hard origin/master