0

I'm on my master branch, when trying to checkout I receive this error: enter image description here

Currently all those folder and file names are in lower case, not upper case. But git used to ignore the casing until I changed its configuration and now this is some kind of left over. I can force checkout and it will work, but is there a way to "remove them" (these paths) although they don't exist in upper case but in lower case? In other words, how can I let git ignore those upper cased paths from now on?

sir-haver
  • 3,096
  • 7
  • 41
  • 85
  • 2
    *Git* **never** ignores the difference between upper and lower case in file names. Your OS may do that at times, and Git will try to accommodate your OS's requirements, but Git doesn't *ignore* it. Remember that `core.ignorecase` (or `core.ignoreCase`—ironically, Git *does* ignore case in configuration setting names!) merely tells Git how your OS behaves. If you lie to Git about how your OS behaves, bad things may happen. Sometimes setting up a temporary, deliberate lie lets you bypass something, but you should always put it back to the truth. – torek Sep 21 '22 at 12:07
  • 1
    In general, you'll find these problems far easier to solve if you set up a case-sensitive file system. How to do that depends on your OS. – torek Sep 21 '22 at 12:08
  • 1
    You should decide which casing version of the files you want, and make sure that's what Git is tracking. This might mean 1.) renaming the files to the proper casing and committing that (which is an add and delete which Git will detect as a rename when viewing history). Or 2.) Deleting your local files and re-checking out to get the version that Git has stored in the commit you are checking out. If the problem is that you don't want to delete your local copy of those files yet, then do something with them first (stash, commit, save them outside of the repo, etc). – TTT Sep 21 '22 at 17:14
  • (cont from previous comment) If the problem is that Git is currently tracking both versions of the file with different cases and you're on a non-case sensitive OS, then you'll probably benefit from deleting one of them. [More info here.](https://stackoverflow.com/a/67095620/184546) – TTT Sep 21 '22 at 17:17

0 Answers0