I'm using Git 1.7.4.1. I want to get the latest version of my code from the repository, but I'm getting errors ...
$ git pull
….
M selenium/ant/build.properties
….
M selenium/scripts/linux/get_latest_updates.sh
M selenium/scripts/windows/start-selenium.bat
Pull is not possible because you have unmerged files.
Please, fix them up in the work tree, and then use 'git add/rm ' as appropriate to mark resolution, or use 'git commit -a'.
I've deleted the local copies of the files the tool is complaining about, but I still get the errors. How do I check out the latest version from the remote repo? - Dave
解决方案
If you don't care about any local changes (including untracked or generated files or subrepositories which just happen to be here) and just want a copy from the repo:
git reset --hard HEAD
git clean -xffd
git pull
Again, this will nuke any changes you've made locally so use carefully. Think about rm -Rf when doing this.