In my repository there is a file (always that one) that always gives me trouble.
I'm working with coffeescript and generating the js with a grunt task.
For several times git status
told me that this file was modified and needed to be added. The problem is that git sees this file duplicated:
Ok..so I try to add everything with git add :/
and all the files are added, included ONE copy of AreaChart.js
while the other one remains modified
and unstaged. If I try to checkout
or add
it manually, nothing happens, its status remains modified
and unstaged.
Is it a git bug? How can I fix this?
EDIT:
actually git sees the same file with 2 different file names, that is AreaChart.js
and Areachart.js
.
If I ls
I only see AreaChart.js
(uppercase C) as it is supposed to be.
HINT:
If I add AreaChart.js
(uppercase C
) --> git adds Areachart.js
(lowercase c
)
If I add Areachart.js
(lowercase c
) --> git adds Areachart.js
(lowercase c
)
EDIT2:
- I found out the both files exist on the repository
- To my surprise I've found out that my filesystem (mac) is not case-sensitive, so if I
touch test
andtouch Test
only one file is created (or maybe both but I can see only one of them) - The output
git config core.ignorecase
saystrue
Look again carefully
and
are different files. One has capital C and other has lower case c character.
Since Git is case sensitive, and your filesystem is case insensitive, you will only see one of these on your filesystem. If you only want one in Git, you should remove the other, with
git rm --cached Areachart.js
, and make sure that your updates are added viagit add AreaChart.js
.