Adding file to git's stage does nothing and cannot be committed
git
Solution
The final solution to this particular problem was to remove both web.config entries from the git cache, commit any changes, and re-add the desired Web.config file back to git.
git rm --cached path/to/Web.config
git rm --cached path/to/web.config
git commit -m "Repair confused cache"
git add path/to/Web.config
git commit -m "Add Web.config"
Problem
I have gotten myself into a bizarre situation where in one of my branches a web.config file cannot be added to the stage. The output of ``` git add path/to/web.config git status ``` Is the same as as before the file was added. Web.config appears to require modifications and has not been added to the stage. Perhaps more interestingly, when I delete the Web.config from the file system and run `git status` I get output that indicates I have two web.config files that are ready to be deleted and are not staged. ``` # Changes not staged for commit: # deleted: path/to/Web.config # deleted: path/to/web.config ``` Note that one has and uppercase W and the other a lowercase w. The file that I removed on the actual file system is an uppercase 'W'. Edit 1 The output of `git ls-files --stage` shows that there are indeed two files that differ by case in the index. ``` 100644 63cd5911b9b12bbad559bb69b1b596708b932061 0 path/to/Web.config 100644 d60ab44bb38f05ffce126ddd3c3293b06e6e4096 0 path/to/web.config ``` I output each of these to a file with `git cat-file -p <hash> > <file>` and compared the two files. While the textual content is the same, the uppercase Web.config contains CRLF endings and the lowercase web.config contains lowercase endings. Edit 2 With the file physically deleted from the file system `git reset HEAD` produces this output but the file is not restored on the file system and therefore cannot be added. ``` Unstaged changes after reset D path/to/Web.config D path/to/web.config ``` I want the file in the working directory to have CRLF as I am working on Windows but I would like for text files to be stored with LF in the internal Git database. So, I assume that would be 63cd591 but I could be off base here. How do I permanently remove path/to/web.config from the index in this scenario? I am on Windows and cannot have two files on my path that differ only by case.