Git – “Will not add file alias ‘samefile’ (‘SameFile’ already exists in index)” when `git add` operation


I download linux' kernel source, and want to git add them all.

When I git add ., git starts add them. But soon it returns an error:

fatal: Will not add file alias 'include/linux/netfilter/xt_connmark.h' ('include/linux/netfilter/xt_CONNMARK.h' already exists in index)

That's weird, xt_connmark.h and xt_CONNMARK.h are TOTALLY DIFFERENT, why it complains that error? Those situations occur at other folders, too. I can't just change their names separately to solve this problem.

Even I try git add --ignore-errors ., it doesn't works,too. It just stopped without ignoring this error. Anyone knows solutions?

Best Solution

Edit .git/config to set ignorecase to false

  ignorecase = false

Can be set globally

$ git config --global core.ignorecase false