Skip to content

Instantly share code, notes, and snippets.

@bastami82
Last active September 5, 2020 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bastami82/a1dec0e131e8d81b10b30aa00fae23d1 to your computer and use it in GitHub Desktop.
Save bastami82/a1dec0e131e8d81b10b30aa00fae23d1 to your computer and use it in GitHub Desktop.
clone all branches of git repository
git branch -a | grep -v HEAD | perl -ne 'chomp($_); s|^\*?\s*||; if (m|(.+)/(.+)| && not $d{$2}) {print qq(git branch --track $2 $1/$2\n)} else {$d{$_}=1}' | csh -xfs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment