LoginSignup
2
2

More than 1 year has passed since last update.

gitのエラー error: remote origin already existsの解決方法

Last updated at Posted at 2021-05-06

エラー内容と解決方法

作成したアプリを自分のgitアカウントのリモートリポジトリにaddしようとしたところ、

$ git remote add origin https://github.com/gitアカウント/リポジトリ名.git
 error: remote origin already exists.

と表示され、うまくいかない。
こちらの記事を参考にして、すでに存在しているリポジトリを削除し、再度addを行うと、うまくできました。
すでに存在しているリポジトリを削除するコマンドは以下の通り。

$ git remote rm origin

これで既存のリポジトリを削除して、再度addすることで、うまくいきました。

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