Skip to content

Instantly share code, notes, and snippets.

@anaynayak
Created February 24, 2014 05:03
Show Gist options
  • Save anaynayak/9182211 to your computer and use it in GitHub Desktop.
Save anaynayak/9182211 to your computer and use it in GitHub Desktop.
A 'git' function that lets you recursively fire the same git command.
function git {
if [ -d .git ]; then
/usr/bin/git $*
else
for dir in $(find . -maxdepth 2 -name ".git"); do
cd ${dir%/*}
/usr/bin/git $*
cd -
done
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment