LoginSignup
776
613

More than 3 years have passed since last update.

gitのremote urlを変更する(レポジトリ移行時)

Last updated at Posted at 2016-04-25

Githubのプライベートレポジトリを移行した時に行ったクライアントの設定です。

前提

以下の項目が完了していること。
- Githubでのプライベートレポジトリ移行
- 自身のPCからGitHubへのssh接続

手順

1 現在のリモートURLを確認する

git remote -v

=>
origin  git@github.com:hoge/current-repo.git (fetch)
origin  git@github.com:hoge/current-repo.git (push)

2 新しいリモートURLに変更する

git remote set-url origin {new url}

3 変更したリモートURLを確認する

git remote -v

=>
origin  git@github.com:hoge/new-repo.git (fetch)
origin  git@github.com:hoge/new-repo.git (push)

はまったところ

{new url}にsshではなくhttpsのpathを指定してたため

remote: Repository not found.

と怒られた。

参考

レポジトリの移行
GitHubのリポジトリを別のOwnerに引き渡す

本家
https://help.github.com/articles/changing-a-remote-s-url/

776
613
1

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
776
613