2

does git reset HEAD@{1} not remove files that were added from git pull?

What I did. I used git pull. Got newest source code. Then found out that code was not good and wanted to restore my code to previous state, so I did git reset HEAD@{1}. It restored back.

But now if I try to do git pull again I will get such error:

error: Untracked working tree file 'addons/auth_crypt/i18n/fr_CA.po' would be overwritten by merge. Aborting

If I rename that file, it throws another same error for another file, that I guess was added on pull before doing git reset. So do I need to remove/rename such files manually and only then I will be able to do git pull. Or is there easier fix (there could be hundreds of such files)?

I also tried git pull --rebase, but get the same error.

Andrius
  • 19,658
  • 37
  • 143
  • 243

1 Answers1

0

You have two files within the same path. One locally and one remote tracked. If you pull your remote tracked would overwrite your local file. That's what git is claiming. Here are further informations available.

Another problem: If you pull again you have the same code contained again that you tried to avoid by using git reset HEAD@{1} because that command didn't change your remote branch.

Community
  • 1
  • 1
Jan
  • 1,004
  • 6
  • 23
  • When I did git pull second time, I actually wanted same code that was when I did first pull, because I checked and now I saw that remote code was OK to be used. Thanks for the link, it solved my problem. – Andrius Feb 25 '15 at 12:33