Skip to content

Instantly share code, notes, and snippets.

@1000k
Last active November 28, 2017 12:34
Show Gist options
  • Save 1000k/0979c45430eee7f8f01cea589391abee to your computer and use it in GitHub Desktop.
Save 1000k/0979c45430eee7f8f01cea589391abee to your computer and use it in GitHub Desktop.
Gitリポジトリの中身を、ブランチとタグも含めて別リポジトリにコピーする ref: https://qiita.com/1000k/items/2a5dcda5fd41f38fd5d5
git clone https://bitbucket.org/1000k/FOOBAR.git
cd FOOBAR/
git branch -r | grep -v "\->" | grep -v master | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
git remote set-url origin https://github.com/1000k/FOOBAR.git
git push --all origin
git push --tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment