Last active
July 5, 2017 14:01
-
-
Save todoshcenko/e9e00993d3953bab79b6b7e69020958e to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
branch=$1 | |
dependenciesDir=$2 | |
for libDir in ${dependenciesDir}/*/ ; do | |
pushd ${libDir} > /dev/null | |
for remoteBranch in $(git ls-remote --heads origin | sed -r 's/\w+\s+//'); do | |
if [ "${remoteBranch}" == "refs/heads/${branch}" ]; then | |
git fetch -q origin ${branch}:${branch} | |
git checkout -q ${branch} | |
echo $(basename ${libDir}) | |
fi | |
done | |
popd > /dev/null | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment