Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save marcelaraujo/f29fa7c67c88e65cb257c6ebdf7292ca to your computer and use it in GitHub Desktop.

Select an option

Save marcelaraujo/f29fa7c67c88e65cb257c6ebdf7292ca to your computer and use it in GitHub Desktop.
Update all the git repositories that you have in a folder
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