Skip to content

Instantly share code, notes, and snippets.

@mmitchel
Created April 29, 2014 17:54
Show Gist options
  • Save mmitchel/11407440 to your computer and use it in GitHub Desktop.
Save mmitchel/11407440 to your computer and use it in GitHub Desktop.
#!/bin/bash
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do
git branch --track ${branch##*/} $branch
done
It will create tracking branches for all remote branches, except master (which you probably got from the original clone command). I think you might still need to do a
git fetch --all
git pull --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment