Skip to content

Instantly share code, notes, and snippets.

@skew202
Created October 25, 2016 10:36
Show Gist options
  • Save skew202/63a2b467e63a7f8b3995fe5be5ed99b3 to your computer and use it in GitHub Desktop.
Save skew202/63a2b467e63a7f8b3995fe5be5ed99b3 to your computer and use it in GitHub Desktop.
git command over subdirectories
# ind . searches the current directory
# -type d to find directories, not files
# -depth 1 for a maximum depth of one sub-directory
# -exec {} \; runs a custom command for every find
# git --git-dir={}/.git --work-tree=$PWD/{} pull git pulls the individual directories
find . -maxdepth 1 -type d -exec git --git-dir={}/.git --work-tree=$PWD/{} pull \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment