Created
June 28, 2017 06:58
-
-
Save marcelaraujo/f29fa7c67c88e65cb257c6ebdf7292ca to your computer and use it in GitHub Desktop.
Update all the git repositories that you have in a folder
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
| Command | |
| `find . -name .git -type d | xargs -n1 -P4 -I% git --git-dir=% --work-tree=%/.. remote update -p` | |
| Using -type d prevents execution for ".git" files inside submodules. Using -P4 runs four fetches in parallel to speed things up a bit (and continues to make progress elsewhere if a single repository hangs). I prefer git remote update -p instead of git pull so that I can deal with merge conflicts later or rebase after I'm offline. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment