More than 5 years have passed since last update.
gitのエラー fatal: remote origin already existsの解決方法
86
Last updated at Posted at 2018-06-11
勉強になったサイト
git エラーの内容
$ git remote add origin https://github.com/ユーザ名/リポジトリ名.git
fatal: remote origin already exists.
なぜこのようなエラーになるのか。ということで検索したら、以下のページを見て解決できた。
http://pyoonn.hatenablog.com/entry/2014/10/29/191744
一度originを削除し、再度originを登録すればよい。
$ git remote rm origin
$ git remote add origin git@github.com:ユーザ名/リポジトリ名.git
自分の場合は、githubのリモートリポジトリをローカルリポジトリに反映させたかったので、この後に以下の命令を行った。
$ git pull origin master
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
