LoginSignup
1
0

More than 3 years have passed since last update.

GitHubのリポジトリを移行

Last updated at Posted at 2020-09-17

すぐに浮かんだ方法

$ rm -rf .git
$ git init
# GitHubでリポジトリを作ってから
$ git remote add origin https://github.com/ユーザーID/リポジトリ名.git
$ git push origin master

この方法でも移行できますが、それまでの編集履歴は全て消えてしまいます。

ちゃんと調べた

以下の2つの記事に書いてある内容を組み合わせればいけそう。

手順

  • 移行元のリポジトリにアクセスしSettingsページを開く
  • ページ下部の「DangerZone」内Transferをクリック
  • 移行先のuser名 or organition名現在のリポジトリ名を入力
  • 必要に応じてorganization内のユーザーのアクセス権を設定
  • ローカルのgit remoteを差し替え
$ git remote set-url origin https://github.com/user_name_or_organization_name/project_name.git

注意点

  • 移譲元と移譲先、両方のリポジトリの管理者でないといけない
  • リポジトリのURLが変わってしまうので、デプロイ用ツール等の設定変更が必要な場合がある
1
0
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
1
0