-
-
Save nucliweb/70ae9af929ddeaff4146c24b58b29ff7 to your computer and use it in GitHub Desktop.
Download All 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 | |
set -x #echo on | |
remote_url=$(git config --get remote.origin.url) | |
for branch in $(git branch --all | grep '^\s*remotes' | egrep --invert-match '(:?HEAD|master)$'); do | |
branch_name=$(echo $branch| cut -d'/' -f 3) | |
git clone -b $branch_name $remote_url $branch_name | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment