2

I changed the ignorecase value on git config to false but now when I edit I file and check the status, git tells me that two files were modified though its actually the same file:

modified:   ACFCache/AcfOptionsPlant.php
modified:   AcfCache/AcfOptionsPlant.php

How can I make git forget the ACFCache entry?

Broshi
  • 3,334
  • 5
  • 37
  • 52

1 Answers1

0

From reading this question I believe the following would have worked for you at the beginning, without even setting ignorecase to false:

git mv ACFCache tempname && git mv tempname AcfCache
git add .
git commit -m 'Changed folder name'

Now, you might try the following:

git checkout -- ACFCache/AcfOptionsPlant.php
git stash    # save changes to AcfCache/AcfOptionsPlant.php ONLY
git mv ACFCache tempname && git mv tempname AcfCache
git commit -m 'Renamed ACFCache folder to AcfCache'
git stash apply
# carry on as you were

I think you can go back to being in ignorecase mode in true:

git config core.ignorecase true
Community
  • 1
  • 1
Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360
  • 1
    Thanks! but I prefer ignorecase to be false to to match my production machine which is case sensitive – Broshi Dec 01 '16 at 09:45
  • @Broshi: `core.ignoreCase` is meant to *inform your* Git how *your* machine actually behaves. In other words, it is the saved result from running a test. Changing it—i.e., lying to your Git about your OS—is likely to create more pain than it resolves. (The reason it is a setting, rather than just having Git test every time, is that the test is relatively expensive. Doing the test on every Git command is not worthwhile, when Git can do the test once, when the repository is created, and save the answer.) – torek Dec 01 '16 at 16:40