1

I have a codebase that has a folder that was written with an upper case letter. I changed it to lower case and committed it.

Before: Onboarding

After: onboarding

Now I saw that all my changes are duplicated when I commit changes to files in that folder.

screens/onboarding/Registration.js
screens/Onboarding/Registration.js

Strange thing is, there is no upper case folder in my filesystem anymore, but somehow Git sees them and even finds changes in them.

How do I get rid of these duplicated files in the (non-existent?) upper case folder?

K..
  • 4,044
  • 6
  • 40
  • 85
  • 1
    What is the value for your `core.ignoreCase` config value? Haven't worked out exactly how this would play out, but I'm wondering if it's set to true and malfunctioning because your filesystem is in fact case-sensitive... – Mark Adelsberger Oct 20 '17 at 14:12
  • `core.ignoreCase` is set to `false` – K.. Oct 20 '17 at 16:03

1 Answers1

1

In your present situation, you should be able to do a

git rm -r -- screens/Onboarding
# add --cached if the folder is not on your disk
git commit -m "Record deletion of screens/Onboarding"

But in your original case, you might have done instead:

git mv -f screens/Onboarding screens/onboarding

(using git mv --force, since Git 2.0.1)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250