Last active
August 29, 2015 13:56
-
-
Save erochest/8830289 to your computer and use it in GitHub Desktop.
Transfer all the branches to another repo.
This file contains hidden or 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 | |
SOURCE=origin | |
DEST=bitbucket | |
for b in $(git branch -r | grep $SOURCE | grep -v -- '->' | sed 's/origin\///' | tr -d ' '); do | |
echo $b | |
git checkout $b | |
git pull | |
git push $DEST $b | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some days I should not be allowed to use the shell.