Skip to content

Instantly share code, notes, and snippets.

@styk-tv
Forked from dbu/git-status-recursive
Created September 7, 2018 19:41
Show Gist options
  • Save styk-tv/ef1311e73dc6bc9c724544c1a0d9d05c to your computer and use it in GitHub Desktop.
Save styk-tv/ef1311e73dc6bc9c724544c1a0d9d05c to your computer and use it in GitHub Desktop.
recursive git status
#!/usr/bin/php
<?php
$repos = array();
exec('find -type d -name .git | sed -e "s/\.git//"', $repos);
foreach ($repos as $repo) {
$status = shell_exec("cd $repo && git status");
if (false == strpos($status, 'nothing to commit (working directory clean)')) {
echo "$repo\n" . str_repeat('-', strlen($repo)) . "\n$status\n\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment