Case sensitivity with file names in VS Code and Windows Git
Answer a question
I'm having an issue with VS Code v1.26.1 on Windows 10. I cloned a repository where, in the same directory, it has file names with the same name but different cases for example: filename.ext and FileName.ext.
VS Code thinks that these are the same file with a change, therefore it is showing them in the Source Control, but when I discard the changes it just changes the names back to the other case + it won't stash or stage them.
I have tried the git config core.ignorecase false and git config --global core.ignorecase false commands but it doesn't seem to do anything. I also tried changing it to true and back to false.
Anyone had/having this issue and found a work around for this?
PS: I cannot change the file names to something else. These file names MUST stay the same.
Answers
Late answer, but Git and Case Sensitivity solved the problem for me.
My project wouldn't compile because it was looking for app.js instead of the file's actual name App.js. I renamed the file in VSCode and the project compiled. However, after every commit, App.js reverted to app.js.
To force git to detect the change I used git-mv.
git mv app App
According to the post author:
The tracked file or folder you want to recapitalize has to be explicitly renamed using a Git command. git mv works the same as mv, except it informs Git that a file or folder has been renamed by immediately staging the change.
更多推荐
所有评论(0)