LoginSignup
28
22

More than 5 years have passed since last update.

【Git】リポジトリをそのまま別の管理ツールへ移行する方法(Backlog→GitLab を例に)

Last updated at Posted at 2015-10-05

経緯

Backlog で管理している Git を大人の事情で GitLab へ移行することになった

前提

  • ディレクトリやファイルを一式移行
  • open, finish に関わらずブランチやタグも引き継ぎ
  • これまでのコミットログも丸ごと
  • ローカルで使用していた Git 用ディレクトリを継続して利用

方法

1. GitLab で新規プロジェクトを作成

  • 移行先として事前に GitLab 側で新規プロジェクトを作成
  • 作成したプロジェクを開きリポジトリの URL を確認

2. 現在 Backlog のリポジトリであることを確認

$ git remote -v
origin  https://***.backlog.jp/git/[プロジェクトキー]/[任意の名称].git (fetch)
origin  https://***.backlog.jp/git/[プロジェクトキー]/[任意の名称].git (push)

3. リポジトリの URL を GitLab に変更

作成したプロジェクトのリポジトリ URL を origin 以下にセット

$ git remote set-url origin https://glab.***.co.jp/[グループ名]/[任意の名称].git

4. GitLab のリポジトリへ変更されたことを確認

$ git remote -v
origin  https://glab.***.co.jp/[グループ名]/[任意の名称].git (fetch)
origin  https://glab.***.co.jp/[グループ名]/[任意の名称].git (push)

5. git push

リモートからチェックアウトしていたブランチは push すると反映

6. GitLab のプロジェクトを確認

Backlog で運用していたものがそのまま GitLab へ移行完了!

28
22
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
28
22