赞
踩
Step 1: Cleaning Up the Working Copy
First, you’ll need to make sure your working copy doesn’t contain these conflicting changes anymore. There are two ways to achieve this:
a) Saving Local Changes on a Stash
If you want to preserve your local changes, you can safely store them on a Stash. They will be available in case you want them back at a later point.
$ git stash --include-untracked
b) Discarding Local Changes
If you are sure that you don’t need them anymore, you can discard your local changes completely:
$ git reset --hard
If you also have untracked / new files, you will have to use the “git clean” command to get rid of these, too:
$ git clean -fd
Please be careful with these commands: discarding local changes and untracked files cannot be undone!
Step 2: Pull Again
After you have cleaned up any local changes / untracked files that would have been overwritten, the pull will finally work:
$ git pull
reference: https://www.git-tower.com/learn/git/faq/git-force-pull/
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。