Skip to content

Instantly share code, notes, and snippets.

@Terminus-IMRC
Created April 13, 2014 08:39
Show Gist options
  • Save Terminus-IMRC/10574894 to your computer and use it in GitHub Desktop.
Save Terminus-IMRC/10574894 to your computer and use it in GitHub Desktop.
A script to pull all remote branches
#!/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