yourfriendzak yourfriendzak - 1 year ago 137
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:
Use -f if you really want to add it.

This is the command I'm trying to execute:

git submodule add MyTest/MyTest/lib/submodules/ScreenRecorder

This is being executed from my git repos root directory.

wkz wkz
Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download