git fetch origin
git reset --hard origin/master
git pull
Explanation:
- Fetch will download everything from another repository, in this case, the one marked as "origin".
- Reset will discard changes and revert to the mentioned branch, "master" in repository "origin".
- Pull will just get everything from a remote repository and integrate.
See documentation at http://git-scm.com/docs.
http://stackoverflow.com/questions/8044675/pull-is-not-possible-because-you-have-unmerged-files-git-stash-doesnt-work-do
时间: 2024-07-30 13:50:36