LoginSignup
0
0

More than 5 years have passed since last update.

githubのリモート設定を間違った時に変更する方法メモ

Posted at

間違ってリモートブランチを設定してしまった際の対処法

git remote -v で現在のリモートブランチを確認できる

そのあとに下記のコマンド
git remote set-url origin xxxx (xxxxにgit@github.com:xxx.git)を入れる

これで再度git remote -vを行うと、再登録したものが表示される

問題が起きた背景

httpのタブの状態でそのまま登録してしまい、パスワードが求められて「え?なにこれ」みたいになって確認したらsshにしていないことがわかり、そのときにどうやって変更するのかな?と調べてわかった

まとめ

あまり使うことがないかもしれないが、もしもの際はgit remote set-url origin xxxxとできるようにしておこーー。
githubをまだまだ使いこなせてないので勉強します。

0
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
0
0