본문 바로가기

Coding/git

master branch and 'origin/master' have diverged, how to 'undiverge' branches'?

git fetch origin
git reset --hard origin/master

 

stackoverflow.com/questions/19864934/git-your-branch-and-origin-master-have-diverged-how-to-throw-away-local-com

 

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

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 ...

stackoverflow.com

 

- 좀 더 구체적이고 친절한 설명

stackoverflow.com/questions/2452226/master-branch-and-origin-master-have-diverged-how-to-undiverge-branches/2452610

 

master branch and 'origin/master' have diverged, how to 'undiverge' branches'?

Somehow my master and my origin/master branch have diverged. I actually don't want them to diverge. How can I view these differences and merge them?

stackoverflow.com