Last active
December 13, 2015 23:19
-
-
Save lelandbatey/4990890 to your computer and use it in GitHub Desktop.
Recursively "git pull" all git directories
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 | |
# Finds all directories named "".git" | |
# Strips the ".git" from the path produced by 'find' | |
# passes that master-folder to xargs which cd's into that directory and runs "git pull" | |
find ~/ -name ".git" -type d | sed 's,/*[^/]\+/*$,,' | xargs -L1 bash -c 'cd "\$1" && git pull' _ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment