1

So here's the issue :

I use git for a repo in windows. Renamed some assets folder and files to lowercase but git didn't track the changes. Resulting in an inconsistent repo in other devices.

How to make git track file/folder name case changes so that it syncs across locations (different OSs too) consistently?

EDIT: I notice before asking that it might a duplicate question but I was looking for a different solution rather than git mv

UPDATE: So git config core.ignorecase false - this seems to be more convenient in that case because you don't have to run git mv every time you've to rename something. Original answer to can be found here

Foez Ahmed
  • 93
  • 10

1 Answers1

3

If you have a directory named Assets and you want to rename it to assets, run git mv Assets assets, and then commit that change. That will tell Git that you want the files in the directory renamed, since on a case-insensitive system, Git has no way of knowing that you've changed the case unless you tell it.

If you want to see what case Git is storing your names in, you can use git ls-files to do so: that will list all the files that are tracked.

bk2204
  • 64,793
  • 6
  • 84
  • 100