LoginSignup
76
70

More than 5 years have passed since last update.

GitHubからGitLabへ移行しよう

Last updated at Posted at 2018-06-05

GitHubからGitLabへ移行しよう

きっかけは、Microsoftは2018年6月4日(米国時間)に、GitHubを(約75億ドルで)買収すると発表したことだ。

1. 登録されているリモートリポジトリの確認

$ git remote -v
origin  git@github.com:~~~~~~ (fetch)
origin  git@github.com:~~~~~~ (push)

2. githubのリモートリポジトリをoriginからgithubへ変更

以下の方法Aまたは方法Bがある。

方法A. 削除と追加

リモートリポジトリの削除

$ git remote rm origin

リモートリポジトリをgithubにして追加しなおす

$ git remote add github git@github.com:~~~~~~

確認した時のURLを入れます。

GitLabのリモートリポジトリをoriginで追加する

方法B. rename

$ git remote rename origin github

3. GitLabをoriginで追加する

$ git remote add origin https://gitlab.com/~~~~~~

4. 最後に確認

$ git remote -v
origin  https://gitlab.com/~~~~~~ (fetch)
origin  https://gitlab.com/~~~~~~ (push)
github  git@github.com:~~~~~~ (fetch)
github  git@github.com:~~~~~~ (push)
76
70
13

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
76
70