Skip to content

Instantly share code, notes, and snippets.

@logosity
Created January 15, 2013 20:38
Show Gist options
  • Save logosity/4541816 to your computer and use it in GitHub Desktop.
Save logosity/4541816 to your computer and use it in GitHub Desktop.
Run git commands in all sub directories of current directory.
#!/bin/bash
find_command="find . -mindepth 0 -maxdepth 1 -type d -print"
git_command="git $*"
for i in $($find_command | sort)
do
[ -d $i/.git ] && echo ${i:2}: $(cd $i; $git_command 2> /dev/null)
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment