A Little Git Trick

Ever find yourself wanting to check the status of every git repo inside a particular folder? Of course you do.

# OSX or FreeBSD
find . -type d -name .git |
  xargs -n1 dirname |
  xargs -I {} git -C {} status
# GNU variants
find . -type d -name .git -printf '%h\n' |
  xargs -I {} git -C {} status

status can obviously be replaced with the git command of your choice. For instance, log -1 --pretty=oneline

Requires git 1.8.5