Created
August 5, 2019 18:57
-
-
Save larsvilhuber/c9e062121864784fd3f6de84bb84f952 to your computer and use it in GitHub Desktop.
git setup all remote branches
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Credit: | |
# https://stackoverflow.com/questions/67699/how-to-clone-all-remote-branches-in-git | |
for branch in $(git branch --all | grep '^\s*remotes' | egrep --invert-match '(:?HEAD|master)$'); do | |
git branch --track "${branch##*/}" "$branch" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment