Windows File History seems to change the case of some file names while saving.

It seems to happen only for filenames with common words, like Plugin.php, Random.php, Functions.php, ...

This all doesn't matter that much in a Windows environment because Windows ignores the case of filenames, but all my websites are hosted on linux servers, so the code breaks because all the modified files cannot be found.

Any clue how to fix this? (apart from using another backup solution)

  • How did you restore your web-sites? – AFH Oct 10 '16 at 13:51
  • @AFH Just opened file history, connected my USB drive and pressed the green Restore button. This copied the files the correct location. without a problem. (I'm not 100% sure if at this point the filenames were changed already.. still figuring that out) – Jules Oct 10 '16 at 13:53
  • I can't think of any way this can happen, especially to a case combination that was never used previously: how was the back-up made? Standard explorer or command-line copies maintain the case, though if you restore over a file where the case has been changed the copy may not restore the saved case unless you delete first. If all the file names should be in a single case (lower or upper) this should be restorable. Otherwise, try to establish whether the save or the restore changed the case. If all else fails, you should be able to restore your local copies from the web-sites themselves. – AFH Oct 10 '16 at 16:40
  • 1
    I just got the same issue. Did my backup with file history feature. Then restored files using File History feature. No manual copy or anything 'hacky'. My Python and PHP projects are all jammed. Hopefully they're on a git server too. – SJousse Apr 4 '17 at 8:33
  • Some files in .git folders were renamed too... – SJousse Apr 4 '17 at 9:00

If you used git, you're in luck for the files and folders not in the git ignore list.

First, set git to be case sensitive. By default this was set true to match Windows:

git config core.ignorecase false

Check the list of changed-case file names Windows messed up:

git status

Now, delete the files and folders that are messed up. Do not delete git ignored files!

Now, get your deleted files back as they were before Windows changed the case:

git checkout .

Yet another reason to quit Windows.

| improve this answer | |
  • In my case I also needed to delete the files that were then detected as changed and then run git clean -fd in order to remove the folders with incorrect case followed by git checkout .. – Steve Chambers May 23 '18 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.