Skip to content

Instantly share code, notes, and snippets.

@ivanrosolen
Created September 12, 2016 12:25
Show Gist options
  • Save ivanrosolen/a65df46e7c405df34de82e7b051231e0 to your computer and use it in GitHub Desktop.
Save ivanrosolen/a65df46e7c405df34de82e7b051231e0 to your computer and use it in GitHub Desktop.
Download all git branches
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