Last active
December 5, 2017 22:42
-
-
Save bmmalone/7dbc980e7bea20ce1db1fc046e4f8314 to your computer and use it in GitHub Desktop.
Pull all of the git repos in the current working directory
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
#! /usr/bin/env bash | |
### | |
# This is `Zarat`'s comment to `leo`'s answer from this SO thread: | |
# https://stackoverflow.com/questions/3497123 | |
# | |
# Plus some additional logic to checkout a branch, if specified | |
### | |
set -x # echo on | |
if [ $# -gt 0 ] | |
then | |
find . -mindepth 1 -maxdepth 1 -type d -print -exec git -C {} checkout "$1" \; | |
fi | |
find . -mindepth 1 -maxdepth 1 -type d -print -exec git -C {} pull \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment