Skip to content

Instantly share code, notes, and snippets.

@agitso
Created February 26, 2013 15:33
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