Last active
August 13, 2020 02:04
-
-
Save peasead/a005a254d7ee0b8042d705ea53ab0c67 to your computer and use it in GitHub Desktop.
Recursively update all git repositories
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 | |
# Run from the parent directory with all of your git folders below | |
# find . 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 . -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} pull origin master \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment