I'm getting this error after I've removed a submodule. The path in question is not in my .gitignore file, nor is there anything relevant in my .git/info/exclude file. I don't have a .gitignore_global file. Why is git trying to ignore this path and how can I fix this?
The following path is ignored by one of your .gitignore files:
Use -f if you really want to add it.
git submodule add https://github.com/kishikawakatsumi/ScreenRecorder.git MyTest/MyTest/lib/submodules/ScreenRecorder
Removing the relevant
[submodule] stanza in my
.git/config solved the issue for me.
My guess that the superrepo will automatically ignore all files in submodules since they are not tracked. Therefore, if there is a stray
[submodule] stanza in your config, git will add the path as an ignore pattern.