Last active
January 9, 2019 10:40
-
-
Save ssi-anik/5a5ca16e234333adb801b80fb1d2be98 to your computer and use it in GitHub Desktop.
Git pull all
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
# https://stackoverflow.com/a/17678331/2190689 | |
function git-pull-all() { | |
START=$(git symbolic-ref --short -q HEAD); | |
for branch in $(git branch | sed 's/^.//'); do | |
git checkout $branch; | |
git pull ${1:-origin} $branch || break; | |
done; | |
git checkout $START; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment