Created
August 1, 2013 11:04
-
-
Save shurph/6130411 to your computer and use it in GitHub Desktop.
Перенос репозитория с github на bitbucket со всеми удаленными ветками.
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 | |
# Copy repo from github to bitbucket | |
# before run this script you should do: | |
# 1. | |
# git clone git@github.com:username/reponame.git | |
# 2. | |
# cd reponame | |
# 3. create new repo on bitbucket | |
# 4. | |
# git remote add bitbucket ssh://git@bitbucket.org/username2/reponame.git | |
# --------- | |
for i in `git branch -r` | |
do | |
remote=`echo $i | cut -b -7` | |
branch=`echo $i | cut -b 8-` | |
if [ "$remote" == "origin/" ] | |
then | |
git checkout $branch | |
git push bitbucket +$branch | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment