Skip to content

Instantly share code, notes, and snippets.

@ssi-anik
Last active January 9, 2019 10:40
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 ssi-anik/5a5ca16e234333adb801b80fb1d2be98 to your computer and use it in GitHub Desktop.
Save ssi-anik/5a5ca16e234333adb801b80fb1d2be98 to your computer and use it in GitHub Desktop.
Git pull all
# 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