4

I have a folder called Utils.

After checking it in to remote I see it appears as utils which fails the build.

I tried to follow renaming methods (maybe I'm doing it wrong) but I'm not able to change it. This is what I tried.

git mv utils Utils 

I'm getting a message that the action failed with no other info

4
  • 2
    Try git mv utils tmp; git mv tmp Utils Commented Dec 30, 2021 at 12:21
  • 1
    Are you on Windows? Which version of git are you using? What is the exact message you got? Commented Dec 30, 2021 at 12:55
  • @SebDieBln - Windows, git ver 2.26.0 Commented Dec 30, 2021 at 13:05
  • stackoverflow.com/search?q=%5Bgit%5D+rename+case+sensitive Commented Dec 30, 2021 at 13:19

1 Answer 1

13

Rename the folder to something else first, then rename it to your expected name:

git mv utils tmp git mv tmp Utils 
Sign up to request clarification or add additional context in comments.

7 Comments

I finally understand - this worked!
Suppose you are just changing case sensitive like: utils to Utils Then first rename as utils as temp, and from temp to Utils Note:- Don't forgot to mention path from root like- packages/client/src/modules/query-browser/pages/ git mv packages/client/src/modules/query-browser/pages/Configure packages/client/src/modules/query-browser/pages/temp git mv packages/client/src/modules/query-browser/pages/temp packages/client/src/modules/query-browser/pages/configure
Say you have an invisible folder on windows invisible in the sense that that casing of the folder isnt on windows, how do you fix that, only git is aware of it as the correct casing you want ALSO exists and is the only thing windows knows of. How to fix on git?
@Morgeth888 I can't follow your sentence. Do you have an example? What is an "invisible folder"? git mv will move the file in the index, so you can do that on Windows as well.
@knittl I got myself in a weird situation somehow, it involved git config core.ignorecase being true. Somehow on git there was both Something/thing.cs and SomeThing/thing.cs and of course windows only has one the correct one Something/thing.cs. I fixed it by deleting the wrong one manually on git without windows involved.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.