Is there a way to chain cmds to submodules within your repo? I am looking for built-in methods as I need this to be portable and without secondary installations.
In my case, I have a workflow pipeline that is based on ls-files (and log) and need to be able to see files that match certain conditions, even if they are in submodules.
git ls-files some/file/path/above/my/submodules/globed-file
June 2015: You can try to execute your command in each submodules, using
git submodule foreach:
git submodule --quiet --recursive foreach "git ls-files yourFile"
One of the submodule will return something, if that file is present in it.
Note that with Git 2.11+ (Q4 2016), you can use instead:
git ls-files --recurse-submodules