Created
June 21, 2017 08:00
-
-
Save Invertisment/d3cd4b1a0056902219261cded567b5cf to your computer and use it in GitHub Desktop.
Git script for managing nested repos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# recursively finds all git repos (2 levels deep) and executes given git command on them | |
# omits .ws .git and .idea directories | |
# | |
# example: bash gitAll.sh pull | |
# result: pull from all repos | |
# | |
find . -not -regex '.*\(.git\|.idea\|.ws\).*' \ | |
-maxdepth 2 -mindepth 2 -type d \ | |
-exec echo {} \; \ | |
-exec git --git-dir={}/.git --work-tree=$PWD/{} $@ \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment