我在使用Git 1.7.4.1。 我想从仓库中获取我的代码的最新版本,但我得到了错误 ...
$ 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 <file>' as appropriate to mark resolution, or use 'git commit -a'.
我已经删除了工具所抱怨的文件的本地副本,但我仍然收到错误。 我如何从远程版本库中检查出最新版本?
如果你不关心任何本地的变化(包括未跟踪的或生成的文件或子库,它们刚好在这里),而只是想从 repo 中得到一份拷贝。
git reset --hard HEAD
git clean -xffd
git pull
同样,这也会使你在本地所做的任何改动失效,所以要小心使用。这样做的时候要考虑到rm -Rf
。