LoginSignup
2
3

More than 5 years have passed since last update.

GitHub に リポジトリを移行する方法

Last updated at Posted at 2017-12-01

リポジトリをGitHubにお引越しのやり方まとめです。
全てのブランチ & タグ もお引越しする方法になります。

リモートリポジトリ の ミラーリングを作成

$ git clone --mirror [リモートリポジトリURL]

clone する際に SSL証明書エラーで怒られたので、対処方法についても、残しています。参考にどうぞ

新しく作成したGitHubリポジトリ URL を追加

ミラーリングで作成したリポジトリに移動

$ cd [ミラーリングで作成したリポジトリのpath]
$ git git remote add new-repository {移行先にリポジトリ URL}

$ git remote set-url origin {移行先にリポジトリ URL} で、origin の urlを変更してもよい

リモートリポジトリにpush

$ git push -f --tags new-repository refs/heads/*:refs/heads/*

origin の url を変更した場合は、new-repositoryorigin にする

2
3
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
2
3