Skip to content

Instantly share code, notes, and snippets.

@alexkasko
Created November 3, 2014 22:01
Show Gist options
  • Save alexkasko/21a2a81511a3c821da13 to your computer and use it in GitHub Desktop.
Save alexkasko/21a2a81511a3c821da13 to your computer and use it in GitHub Desktop.
git fetch all oneliner
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}' | bash -xfs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment