Created
October 13, 2017 22:34
-
-
Save red-avtovo/b840c731a1d8d12272e5e70a4ac026f3 to your computer and use it in GitHub Desktop.
push remote git repository to other remote
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 | |
#move all branches from repo1 to repo2 | |
repo1=origin | |
repo2=gogs | |
branches=$(git branch -r | grep -v $repo2 | grep -v $repo1/HEAD) | |
echo $branches | while read line ; do | |
branch=${line:${#repo1}+1} | |
git checkout $branch | |
git push $repo2 $branch | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment