LoginSignup
40
42

More than 5 years have passed since last update.

bitbucketからgithubにリポジトリを1分で移すための4ステップ

Last updated at Posted at 2015-09-09

bitbucketにプライベートリポジトリつくって開発してたけど、公開したくなったときにやった手順。

1.--mirrorオプションでclone

git clone --mirror https://bitbucket.org/username/repository-to-mirror.git

2.githubにリポジトリを用意

もし作ってない場合は作成しておく必要あり。

3.remote set-urlで移動先のリポジトリと指定

cd repository-to-mirror.git で移動したら、remote urlを設定

git remote set-url --push origin https://github.com/username/mirrored

4.最後に--mirrorをつけてpush

username/passwordが聞かれたらgithubアカウントのものを入力すればOK。

git push --mirror

思ったより簡単。

参考

Duplicating a repository - User Documentation
How to move git repository with all branches from bitbucket to github? - Stack Overflow

40
42
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
40
42