LoginSignup
3
4

More than 5 years have passed since last update.

gitのリモートURLを変更した話

Posted at

gitのリモートURL(でいいのかな?cloneとかに使うやつ)を変更したい事案が発生したのでメモ。

やりたいこと


個人のRepositoryで管理していたものをあるOrganizationsに移したい。
https://git.example.com/hoge/sample
https://git.example.com/fuga/sample にしたいのでござる。

どうやんの?


  • とりあえず現状の確認をば
$ git config -l | grep remote.origin.url
remote.origin.url=ssh://git@git.example.com/hoge/sample.git

⇒ hogeになっていることが確認できる。

  • 魔法のコマンドを打つべし、打つべし!
$ git remote set-url origin git@git.example.com:fuga/sample.git
  • どうなったかな…
$ git config -l | grep remote.origin.url
remote.origin.url=ssh://git@git.example.com/fuga/sample.git

…おっ!?ktkr

_人人人人人人人人人人人人人人人人人人人人人_
> git.example.com/fuga/sample.git <
 ̄Y^Y^Y^Y^Y^Y^Y^^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y ̄
キタ━━(゚∀゚)⌒Y⌒(。A。)⌒Y⌒(゚∀゚)⌒Y⌒(。A。)⌒Y⌒(゚∀゚)━━!!

さいごに


pullとかちゃんとできることも確認しよう!

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