Skip to content

Instantly share code, notes, and snippets.

@lelandbatey
Last active December 13, 2015 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lelandbatey/4990890 to your computer and use it in GitHub Desktop.
Save lelandbatey/4990890 to your computer and use it in GitHub Desktop.
Recursively "git pull" all git directories
#!/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