LoginSignup
0
0

More than 1 year has passed since last update.

【Github】リポジトリを別のOrganizationに移行する方法

Posted at

解決したいこと

GitHubのOrganizationを使用して開発していたが、Ownerが飛んでしまったがOwnerがその方しか設定されておらずリポジトリ等の設定がなにもできない状態になった。
その為、今後の更新は見られないように別のOrganizationを作り、リポジトリを移行したい。

必要な情報

・移行元GitリポジトリURL
・移行先GitリポジトリURL(空のリポジトリを作成しておいてください)

手順

以下のリポジトリを例に解説します。
移行元:https://github.com/移行元Organization名/移行元リポジトリ名
移行先:https://github.com/移行元Organization先/移行先リポジトリ名

① 移行元リポジトリをローカルにミラークローンする

git clone --mirror https://github.com/移行元Organization名/移行元リポジトリ名

② ①でクローンしたフォルダに移動する

cd 移行元リポジトリ名.git

③ ミラークローンしたものを移行先GitリポジトリへPUSHする

git push --mirror https://github.com/移行元Organization先/移行先リポジトリ名

ローカルPCに持ってきたリポジトリを新リポジトリへPUSHします。
これで移動(コピー)が完了です。

補足

移動が完了したら、ローカルにクローンしたファイルは削除して構いません。
(ファイルの物理削除でOKです。)

0
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
0
0