Skip to content

Instantly share code, notes, and snippets.

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 davidjguru/38b8043ce5cc359755c600fc15011152 to your computer and use it in GitHub Desktop.
Save davidjguru/38b8043ce5cc359755c600fc15011152 to your computer and use it in GitHub Desktop.
How to get all the code from remote repository from all the available remote branches.
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment