zehreken zehreken -4 years ago 142
Git Question

How do I check 'git status' for some sub folders?

We are using a custom version of composer for our package manager.

Every package we add to our project is actually a


Naturally, those folders (/Vendor/packages/) are ignored by the parent repo and when I write
git status
it only shows the current repo's status.

Is there way to check status of the .git repos under my project.

I'm looking for something like
git submodule foreach status

Answer Source

You could use find sub-directories in Vendor/packages and execute git status on each one of them.

find Vendor/packages -type d -maxdepth 1 -print -exec sh -c '(echo {} && cd {} && git status && echo)' \;

This is with the assumption that all folders under Vendor/packages are git repos by themselves.

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