0

On my local system, I had a file named FarmApi, whereas in my remote repository it was named farmApi. Having noticed that and then read this, in my .gitconfig and in my .git\config I went ahead and set:

[core]
    ignorecase = false

That allows me to add, commit, and push the case sensitive change. The problem now is that the remote repository has both farmApi and FarmApi whereas our local has only FarmApi.

Remote

Remote

Local

Local

Why are the case sensitive changes out of sync? How do we remedy this?

Community
  • 1
  • 1
Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467

1 Answers1

1

While I am not certain what steps you took, you ended up adding, rather than renaming, the file as far as Git is concerned (probably by renaming on your local machine without doing a git mv), thus you have the two copies in your repository. The reason why this is not reflected in your working directory is that the two files only differ by case, and on Windows (which I assume you are on) you cannot have files that only differ by case; they are considered the same file.

To get out of the situation, make a backup of the file, and then git rm it. Do a git add --all just to be sure, and then commit; this should get rid of both files on the repo. Then restore your backup and re-add the file.

David Deutsch
  • 17,443
  • 4
  • 47
  • 54
  • It seems that case insensitivity is not such a good idea for an OS. I've heard that before and now I'm starting to understand. – Shaun Luttin Jun 19 '15 at 14:26