On OSX 10.10.2 and Git 2.2.1 with this filesystem: File System Personality: Journaled HFS+ Type (Bundle): hfs Name (User Visible): Mac OS Extended (Journaled)
I've seen several questions and answers related to this: Unresolvable Git error: The following untracked working tree files would be overwritten by checkout
The actual solution that worked in that question is not clearly specified but involves:
It took me some file history breakup (deleting and re-adding files) to resolve this error after setting the option to true.
I've tried the other solutions presented, but I am still left with the problem of how to move the file correctly.
Having run:
sudo git config --unset-all core.ignorecase && sudo git config --system core.ignorecase false
I then still cannot rename the files using (git 2.2.1) because I get a fatal: destination exists
error:
git mv File.name file.name
I can rename them using:
git mv File.name File.name.tmp
git mv File.name.tmp file.name
However I am then unable to checkout an older commit/branch because I get this message:
error: The following untracked working tree files would be overwritten by merge:
File.name
If I force the checkout or change ignorecase to true, I can switch branches, but then I can't still can't merge in the changes because I get this message:
error: The following untracked working tree files would be overwritten by merge:
file.name
Note that the conflicting file name changes its case in those two error messages. Running a git reset --hard HEAD
doesn't resolve the issue in either of these cases.
Is this a bug in git? Am I doing it wrong? I don't see anyway to force that merge, what else can I do? Do have have to remove and re-add the file, thus breaking the history of changes to that file?
Edit: So far it seems like the only solution (that preserves file history and doesn't require breaking older releases by rewriting project history) is to split the renaming up into two commits and then require anyone that merges this branch to manually merge twice.