Created
September 5, 2017 04:13
-
-
Save unique1984/5653330065cbb3ab997b0febed79b0f7 to your computer and use it in GitHub Desktop.
Pull all Git repositories nested one directory recursively
This file contains 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 | |
if [ -z $1 ]; then | |
find -type d -name .git -exec echo {} \; -exec git --git-dir={} --work-tree=$PWD/{}/.. fetch --all \; -exec git --git-dir={} --work-tree=$PWD/{}/.. pull origin master \; | |
else | |
find $1 -type d -name .git -exec echo {} \; -exec git --git-dir={} --work-tree=$PWD/{}/.. fetch --all \; -exec git --git-dir={} --work-tree=$PWD/{}/.. pull origin master \; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment