Skip to content

Instantly share code, notes, and snippets.

@4lberto
Created May 29, 2018 10:08
Show Gist options
  • Save 4lberto/d90b7b1a4a0b90c62961e1ba77bc7a86 to your computer and use it in GitHub Desktop.
Save 4lberto/d90b7b1a4a0b90c62961e1ba77bc7a86 to your computer and use it in GitHub Desktop.
Clone and upload all remote branches of a repo
git clone https://git.myrepo.com/group/reponame.git
cd reponame
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
cd ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment