1

With MinGW Git on Windows, I cannot add a new folder. It repeatedly fails, saying

fatal: Will not add file alias 'newfolder/file.txt' ('newfolder/File.txt' already exists in index)

I have attempted to look for the "existing" file with git ls-files newfolder, but it returns nothing.

Michael
  • 8,362
  • 6
  • 61
  • 88

1 Answers1

0

Note the casing. There are two files in the folder, named the same thing with different capitalization.

MinGW is trying to let you ignore case, but after adding one of the files, is failing to add the other one because it sees their file names as equivalent.

I don't have the slightest notion how it happens, but (contrary to Keith's comment below) this is definitely not impossible.

Windows explorer screenshot

Michael
  • 8,362
  • 6
  • 61
  • 88
  • "_MinGW is trying to let you ignore case_". Huh? _MS-Windows'_ file system is _case-insensitive_; you simply __cannot__ have two distinct files in the same directory, (or "folder", if you prefer that degenerate nomenclature), with names differing only in capitalization, (with the standard OS configuration). This is a basic feature of windows itself; MinGW has nothing whatsoever to do with it. – Keith Marshall Aug 20 '15 at 16:59