Skip to content

Instantly share code, notes, and snippets.

@clintmod
Created August 8, 2014 05:43
Show Gist options
  • Save clintmod/f73b29c20ba3bf0c25f2 to your computer and use it in GitHub Desktop.
Save clintmod/f73b29c20ba3bf0c25f2 to your computer and use it in GitHub Desktop.
git checkout every remote branch (so you can push them all to a different repo) using git push newRepo --all
for branch in $(git for-each-ref --format='%(refname:short)' refs/remotes/origin | grep -v HEAD | sed 's:^origin/::'); do git checkout "$branch"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment