0

When trying to update (pull) changes to my local git repository, I get the error that there are untracked files:

> git pull origin
Updating 556678a..e6eb9b0
error: The following untracked working tree files would be overwritten by merge:
        templates/Sammel RKA Süddeutsche EM MU15 am 17.10.2015.doc
Please move or remove them before you can merge.
Aborting

I can confirm this using git status:

> git status
On branch feature/KRAS-6
Your branch is behind 'origin/feature/KRAS-6' by 16 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        "templates/Sammel RKA Su\314\210ddeutsche EM MU15 am 17.10.2015.doc"

nothing added to commit but untracked files present (use "git add" to track)

Then I use git clean to have a clean working directory:

> git clean -f -n
Would remove "templates/Sammel RKA Su\314\210ddeutsche EM MU15 am 17.10.2015.doc"
> git clean -f   
Removing "templates/Sammel RKA Su\314\210ddeutsche EM MU15 am 17.10.2015.doc"

Having a look at git status now, it shows that the file has been deleted (but this implies that it was tracked before?):

> git status
On branch feature/KRAS-6
Your branch is behind 'origin/feature/KRAS-6' by 16 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        deleted:    "templates/Sammel RKA S\303\274ddeutsche EM MU15 am 17.10.2015.doc"

no changes added to commit (use "git add" and/or "git commit -a"

Any idea how to clean this mess up? Could it be related to the spaces or special chars in the filename?

Daniel
  • 1,398
  • 4
  • 20
  • 47

1 Answers1

1

Seems to have a problem with the ü.
Maybe try doing git checkout . this should revert all changes you made to tracked files and thus the deletion it thinks is there.
I hope then it doesn't show it as untracked again. Would be strange.

Vampire
  • 35,631
  • 4
  • 76
  • 102
  • Did as you suggested. It is again shown as untracked: Untracked files: "templates/Sammel RKA Su\314\210ddeutsche EM MU15 am 17.10.2015.doc"` – Daniel May 10 '16 at 09:42
  • Well, the problem IS the `ü`. In Unicode you can use the `ü` character directly, or an `u` followed by a combining diaeresis (the dots above). It is stored in Git in the first form, but somehow if you have the file locally it is recognized in the second form. This means if the file is there it sees it as a different file, if it is not there it sees it as missing file. Very strange situation. What happens if you `git add` the untracked file? – Vampire May 10 '16 at 09:49
  • Hm, strange. After adding it, it is recognized as new file. – Daniel May 10 '16 at 10:34
  • Ok, try the follwing. Do a `git reset`, then it should be untracked again. Then rename the file to something without the `ü`. Then try renaming it back to the old name, but do not use copy & paste, but really type the `ü`. And then check what `git status` says. – Vampire May 10 '16 at 10:45
  • Really interesting... after `git reset` it is indeed untracket again. After the renaming operation, it is still untracked (Su\314\210ddeutsche), but additionally a change not staged for commit is shown (same file, but "S\303\274ddeutsche"). – Daniel May 10 '16 at 20:32
  • Found the solution: was actually an umlaut problem and a known issue on GIT on OS X according to this answer: http://stackoverflow.com/questions/5581857/git-and-the-umlaut-problem-on-mac-os-x – Daniel May 10 '16 at 20:57
  • Ah, so I was right about the umlaut problem. Would have helped if you would have mentioned that this happens on OS X. ;-) – Vampire May 10 '16 at 21:16
  • Actually you were right, yes. And yes, it would have helped. Sorry, I really did not expect this to be an OS related problem. Upvoted your answer, but actually i flagged this question as dupe, so let's see what happens. Thanks for your help! – Daniel May 10 '16 at 21:18
  • And I voted for close as dup. :-) – Vampire May 10 '16 at 21:29