Created
May 21, 2019 08:32
-
-
Save tonythomas01/6c0d05a304bf9f5c74f2e9569cd38523 to your computer and use it in GitHub Desktop.
Update all repos in your directory to a branch.
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 | |
# This will update all git repos in your present working directory to target: branch | |
# Inspired from: https://stackoverflow.com/a/31994428 | |
read -p 'Branch to switch to: ' branch | |
for d in */; do cd $d; git stash; git checkout $branch; (git pull origin $branch); cd ..; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment