如何获取最新版本的代码? [英] How do I get the latest version of my code?
问题描述
我正在使用Git 1.7.4.1.
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 <file>' 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 repository?
推荐答案
如果您不关心任何本地更改(包括恰好在这里的未跟踪或生成的文件或子存储库),而只想从存储库中获取副本:
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
同样,这会取消您在本地所做的任何更改,因此请谨慎使用.这样做时,请考虑 rm -Rf
.
Again, this will nuke any changes you've made locally so use carefully. Think about rm -Rf
when doing this.
这篇关于如何获取最新版本的代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!