Advertisement

Visual Studio's Lower- and Upper-Case Ignorance

Started by September 18, 2016 02:18 PM
4 comments, last by Angelic Ice 8 years, 2 months ago

Hello forum!

Quite a simple problem probably rather with Windows way its working than Visual Studio.

Is there any way to force Visual Studio to clean up its file name lookup? Let's say I had a file once named My_Class.h and now renamed the original file to my_class.h, Visual Studio will still show it as My_Class.h and also push that exact file name to my Git.

But I want it to push my_class.h to Git and also show that name in the solution explorer.

Thanks for taking your time to read my thread : ) Hopefully somebody can help me out as this is a life threatening issue, haha.

Windows (and thus most Windows software) ignores case when it comes to file paths, so you cannot change ONLY case.

Just rename it to anything.h and then back to my_class.h

Advertisement
I would try opening up the project in a text editor and changing the case there.
You can also use powershell or command prompt:


PS> $null | out-file Test.a
PS> ls "test*" | select -expand Name
Test.a

PS> mv Test.a test.a
PS> ls "test*" | select -expand Name
test.a

As I figured out for my VS solution generator tool, there are file names in your proj. file that were added to build process and also some that may be contained in a filters file that are shown "as if" they were in certain directory so you meay need to edit both files. I have had the same problem the other way when adding an upper case file to a solution and then commiting on SVN the other user downloading them had them in lower case (btw)

I would try opening up the project in a text editor and changing the case there.

Thanks : ) Did not think of that solution, it was very quick and efficient.

I fixed this issue for the display in my Visual Studio explorer, but committing them to my Git via the Team Explorer still keeps them in upper case.

Are there any configuration files in my .git folder I can change in order to correct that?

This topic is closed to new replies.

Advertisement