Skip to content

Instantly share code, notes, and snippets.

@luisinder
Created April 9, 2015 07:43
Show Gist options
  • Save luisinder/1d904af05c978719e99a to your computer and use it in GitHub Desktop.
Save luisinder/1d904af05c978719e99a 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
@luisinder
Copy link
Author

git checkout -t origin/branch-name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment