DEV Community

dala00
dala00

Posted on • Originally published at crieit.net

2 1

BitBucketからGitHubのプライベートリポジトリに引っ越した

GitHubのプライベートリポジトリが無料でも作れるようになりました! 無料で共有できるのは3人までですが、僕がやっているような個人開発は一人で使うことが多いため非常に嬉しいです。

ずっとプライベートリポジトリとしてBitBucketを使っていましたが、重かったり使いづらかったりで不満はあり、GitHubを使いたかった気持ちはあったので、とりあえず一番頻繁に使っているCrieitのリポジトリをBitBucketからGitHubに引っ越ししてみました。

GitHubでプライベートリポジトリを作成

まずはGitHubにて空のプライベートリポジトリを作成しておきます。

Create a New Repository.png

各環境のremote参照を変更

開発環境、本番環境など、Gitで参照しているremoteのURLを変更します。とりあえず現状のURLを見てみます。

$ git remote -v
origin  git@bitbucket.org:alphabrend/dev.git (fetch)
origin  git@bitbucket.org:alphabrend/dev.git (push)
Enter fullscreen mode Exit fullscreen mode

URLを変更します。

git remote set-url origin git@github.com:dala00/crieit.git
Enter fullscreen mode Exit fullscreen mode

再度確認してみると変更されていることがわかります。

$ git remote -v
origin  git@github.com:dala00/crieit.git (fetch)
origin  git@github.com:dala00/crieit.git (push)
Enter fullscreen mode Exit fullscreen mode

実際にpushしたりする際にはGitHubの方にも鍵を登録しておく必要があります。ローカルはBitBucketにもGitHubにも登録しているかもしれませんが、本番環境は個別に登録していく必要がある場合が多そうです。

諸々準備できたらfetchしたりpushしたりを試してみてください。(まだざっとしか試していないのでうまくいかなかったらすみません…)

草も移動するっぽい

多分ちゃんと草も移動してくれてるっぽい(?)です。

contribution.png

まとめ

あとはCIとかも引っ越す必要がありますのでまた対応したら記事を書いていきます。

Crieitはdev.toとQiitaを参考に作った、というところからdevという変なリポジトリ名になっていたのですが、この機会にちゃんとしたリポジトリ名にできたのも良かったです。

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay