#!/bin/sh # git-uptodate -- find out-of-date repositories [ -z "$1" ] && { echo usage: $0 dir 1>&2; exit 1; } find "$1" -type d -name .git | while read -r dir; do ( cd "$dir"/.. git status -uno | sed -n '/^Your branch/{s///;p}' | while read -r s; do cd - printf '%s %s\n' "$(readlink -f "$dir"/..)" "$s" break done ) done | grep -v 'up to date'