Created
April 13, 2014 08:39
-
-
Save Terminus-IMRC/10574894 to your computer and use it in GitHub Desktop.
A script to pull all remote branches
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
#!/bin/sh | |
CURRENT=$(git symbolic-ref HEAD | sed 's,refs/heads/,,') | |
echo Current branch: $CURRENT | |
BRANCHES=$(git branch -r | fgrep -v -- '->' | cut -d/ -f2-) | |
echo All branches: $BRANCHES | |
for REMOTE in $BRANCHES; do | |
git checkout $REMOTE | |
git pull --ff-only | |
done | |
git checkout $CURRENT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment