Skip to content

Instantly share code, notes, and snippets.

@awmpietro
Created May 8, 2023 21:29
Show Gist options
  • Select an option

  • Save awmpietro/70ae06987528ee12b5c3e93e1811f526 to your computer and use it in GitHub Desktop.

Select an option

Save awmpietro/70ae06987528ee12b5c3e93e1811f526 to your computer and use it in GitHub Desktop.
run this shell script to recreate all remote branches locally from a remote repository
#!/bin/bash
for b in `git branch -r | grep -v -- '->'`; do git branch --track ${b##origin/} $b; done
git fetch --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment