本文参考:http://stackoverflow.com/questions/19864934/git-your-branch-and-origin-master-have-diverged-how-to-throw-away-local-com 如果不需要保留本地的修改,只要执行下面两步: git fetch origin git reset --hard origin/master