1

I have refactored the name of messageServices to MessageServices, but I did it properly so not sure what's going on and why.

WHen I got to commit, I see that there are two checked files, messageServices and MessageServices, though in my file tree I only see the later.

I tried unchecking the first (lowercase m) but it still gives that error. How do I solve this?

This is the error I am getting when I try to commit

Tsabary
  • 3,119
  • 2
  • 24
  • 66
  • The problem might be arising from the fact that you are working on Windows. Keep in mind that to Windows the two files are "the same", before and after renaming it.... and git depends on the FS to check the contents of the files and stuff. I've seen this kind of problem solved so I'm not completely surprised by this. I've seen people recommending to use a temporary when renaming but I don't know the exact recipe. – eftshift0 Feb 25 '19 at 23:42
  • Possible duplicate of ["Will not add file alias 'samefile' ('SameFile' already exists in index)" when \`git add\` operation](https://stackoverflow.com/questions/25580440/will-not-add-file-alias-samefile-samefile-already-exists-in-index-when) – Zoe Feb 26 '19 at 06:04

1 Answers1

0

Actually, I made such type of error by my ownself mistake.

Blockquote firstly, I created file name with Small letters, later I changed file name in the capital letters which is git not tracking

  1. Change capitalization of "file" name and add "1" to the end (or another symbol)
  2. Stage (without commit) = result "File1" - renaming files
  3. Remove "1" from the end
  4. Stage (without commit) = result "File" - renaming files (only capitalization now)
  5. Now Do commit.

also try this- $ git config --local core.ignorecase false

Reference

Santosh Kumar
  • 552
  • 4
  • 13