Skip to content

Instantly share code, notes, and snippets.

@cossio
Created January 8, 2018 15:56
Show Gist options
  • Save cossio/7ddf9a342ba05aa762c285d1d89fa706 to your computer and use it in GitHub Desktop.
Save cossio/7ddf9a342ba05aa762c285d1d89fa706 to your computer and use it in GitHub Desktop.
I keep this script around which lets me apply a git command to every subdirectory:
#!/usr/bin/env zsh
submodules=("${(@f)$(find . -type d -depth 1)}")
for submodule in $submodules
do
print "=== $submodule"
git --work-tree=$submodule --git-dir=$submodule/.git $*
print
done
@cossio
Copy link
Author

cossio commented Jan 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment