Skip to content

Instantly share code, notes, and snippets.

@4lberto
Created May 29, 2018 10:08
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