You might want to edit the .git/info/exclude file to add a template to ignore. But for the submodule this will not work. Instead, you should edit .git/submodule_foo/info/exclude , from the root of the Git repository.
This is because in newer versions of Git, the submodule_foo/.git path is a file, not a directory. Its contents allow us to find out where the .git files for the submodule are:
gitdir: ../.git/modules/submodule_foo
Flimm source share