Skip to content

Instantly share code, notes, and snippets.

@Alexzanderk
Created April 14, 2020 06:55
Show Gist options
  • Select an option

  • Save Alexzanderk/c6fb4cdfd73c961b6d447715dd449688 to your computer and use it in GitHub Desktop.

Select an option

Save Alexzanderk/c6fb4cdfd73c961b6d447715dd449688 to your computer and use it in GitHub Desktop.
Get all remote branches to local
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment