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.proper
If the above commands didn't help you use this method:
You have to merge your files first. Do a git status
to see what are the files that need to be merged (means you need to resolve the conflicts first). Once this is done, do git add file_merged
and do your pull
again.
It sounds to me like you're having core.autocrlf-problems. core.autocrlf=true can give problems like the ones you describe on Windows if CRLF newlines were checked into the repository. Try disabling core.autocrlf for the repository, and perform a hard-reset.
I suspect that what's happened may be that you've deleted the files that you modified (because you didn't care about those changes) and now git is taking the deletion to be a change.
Here is an approach that moves your changes out of your working copy and into the "stash" (retrievable should it actually turn out that you ever need them again), so you can then pull the latest changes down from the upstream.
git stash
git pull
If you ever want to retrieve your files (potential conflicts with upstream changes and all), run a git stash apply
to stick those changes on top of your code. That way, you have an "undo" approach.
I understand you want to trash your local changes and pull down what's on your remote?
If all else fails, and if you're (quite understandably) scared of "reset", the simplest thing is just to clone origin into a new directory and trash your old one.