Skip to content

Instantly share code, notes, and snippets.

@Dylancyclone
Created February 3, 2023 22:40
Show Gist options
  • Save Dylancyclone/462f9e6114ad04e0a868bfa3df62de34 to your computer and use it in GitHub Desktop.
Save Dylancyclone/462f9e6114ad04e0a868bfa3df62de34 to your computer and use it in GitHub Desktop.
pull and track all remote 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
@Dylancyclone
Copy link
Author

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