Created
April 11, 2010 23:38
-
-
Save samsonjs/363139 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 zsh | |
git-pull-all-branches() { | |
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then | |
echo "$pwd is not part of a git repo" | |
return | |
fi | |
origbranch=$(git branch | fgrep '*' | sed -e 's/\* //') | |
bs=($@) | |
[[ -z "$bs" ]] && bs=($(git branch | sed -e 's/\* //')) | |
for b ($bs) { | |
git checkout $b | |
git pull origin $b | |
} | |
git checkout $origbranch | |
} | |
alias pab='git-pull-all-branches' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment