Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bogdanRada/2b812ea05371425f7bb8 to your computer and use it in GitHub Desktop.
Save bogdanRada/2b812ea05371425f7bb8 to your computer and use it in GitHub Desktop.
git-copy-remote-branches-to-local-branches
#!/bin/bash
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do
git branch --track ${branch#remotes/origin/} $branch
done
git fetch && for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do git branch --track ${branch#remotes/origin/} $branch; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment