Skip to content

Instantly share code, notes, and snippets.

@eugenehp
Created November 4, 2016 21:29
Show Gist options
  • Save eugenehp/3d981e714c5de9c9a01f15581f52765a to your computer and use it in GitHub Desktop.
Save eugenehp/3d981e714c5de9c9a01f15581f52765a to your computer and use it in GitHub Desktop.
git clone all remote branches locally
#!/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