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?
Edit .git/config to set ignorecase to false
[core]
ignorecase = false
Can be set globally
$ git config --global core.ignorecase false
Use
git rm --cached <file>
This will completely remove the file's contents from the index but leaves it in the working directory. On commit, the files will be removed from the HEAD commit.
I would recommend to backup your project before doing that.
Actually, I made such type of error by my ownself mistake.
firstly, I created file name with Small letters, later I changed file name in the capital letters which is git not tracking
or try this
$ git config --local core.ignorecase false
Reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With