Skip to content

Instantly share code, notes, and snippets.

@abrookins
Created April 9, 2012 21:10
Show Gist options
  • Save abrookins/2346563 to your computer and use it in GitHub Desktop.
Save abrookins/2346563 to your computer and use it in GitHub Desktop.
Add submodules to a git repo for every directory in the current directory
for dir in *; do cd $dir && git remote show origin -n | grep Fetch | awk '{split($0,array," ")} END{print array[3]}' | xargs -I {} git submodule add {} $dir && cd ..; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment