yourfriendzak yourfriendzak - 1 month ago 9
Git Question

Error after removing submodule: The following path is ignored by one of your .gitignore files:

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:
MyTest/MyTest/lib/submodules/ScreenRecorder
Use -f if you really want to add it.


This is the command I'm trying to execute:

git submodule add https://github.com/kishikawakatsumi/ScreenRecorder.git MyTest/MyTest/lib/submodules/ScreenRecorder


This is being executed from my git repos root directory.

wkz wkz
Answer

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.

Comments