git:我如何获得我的代码的最新版本? [英] git: How do I get the latest version of my code?

查看:519
本文介绍了git:我如何获得我的代码的最新版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Git 1.7.4.1。我想从存储库中获取我的代码的最新版本,但我收到错误...

  $ git pull 
...。
M selenium / ant / build.properties
...。
selenium / scripts / linux / get_latest_updates.sh
M selenium / scripts / windows / start-selenium.bat
由于您有未合并的文件,因此无法拉取。
请将它们修改为工作树,然后根据需要使用'git add / rm

我已经删除了该工具所抱怨的文件的本地副本,但我仍然得到错误。如何从远程回购中检出最新版本? - Dave

解决方案

如果您不关心任何本地更改(包括刚刚发生的未跟踪或生成的文件或子库)

pre $ g $ git reset --hard HEAD
git clean -xffd
git pull

同样,这将会破坏您在本地所做的任何更改,请谨慎使用。这样做时请考虑 rm -Rf


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 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.

这篇关于git:我如何获得我的代码的最新版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆