Skip to content

Instantly share code, notes, and snippets.

@agitso
Created February 26, 2013 15:33
Show Gist options
  • Save agitso/5039343 to your computer and use it in GitHub Desktop.
Save agitso/5039343 to your computer and use it in GitHub Desktop.
PHP Cli script to do a 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