Skip to content

Instantly share code, notes, and snippets.

@anirudh-ramesh
Created May 25, 2016 06:20
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 anirudh-ramesh/e94d1db6b8d80e5fce25af2c357184e6 to your computer and use it in GitHub Desktop.
Save anirudh-ramesh/e94d1db6b8d80e5fce25af2c357184e6 to your computer and use it in GitHub Desktop.
Clones all branches from a git remote
# git clone <>
# cd <>
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