1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GitHubリポジトリの移行

Posted at

はじめに

  • GitHubで管理しているリポジトリを別のorganizationへ移行する時の手順になります。
  • rails、capistranoを利用しているリポジトリ

やること

  • GitHubリポジトリの移行

    • Settings → Options → Transfer ownership 実行
  • Deploy設定を新Organizationのものに変更する

    • 独自Gem(あれば)のURL変更
    • deploy.rbの修正
  • /var/www/hoge/repo/ディレクトリを削除

  • デプロイサーバのgitのリポジトリ向き先変更

    # 変更前の確認
    $ git remote -v
    origin	git@github.com:old_pj/hoge.git (fetch)
    origin	git@github.com:old_pj/hoge.git (push)
    
    # 接続先変更
    $ git remote set-url origin git@github.com:new_pj/hoge
    
    # 変更後の確認
    $ git remote -v
    origin	git@github.com:new_pj/hoge (fetch)
    origin	git@github.com:new_pj/hoge (push)
    

移行後ローカルのgit設定変更

# 変更前の確認
$ git remote -v
origin	git@github.com:old_pj/hoge.git (fetch)
origin	git@github.com:old_pj/hoge.git (push)

# 接続先変更
$ git remote set-url origin git@github.com:new_pj/hoge.git

# 変更後の確認
$ git remote -v
origin	git@github.com:new_pj/hoge.git (fetch)
origin	git@github.com:new_pj/hoge.git (push)
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?