VOOZH about

URL: https://qiita.com/hatorijobs/items/1cae1946656ece954c63

⇱ gitのエラー fatal: remote origin already existsの解決方法 #GitHub - Qiita


👁 Image
86

Go to list of users who liked

55

Share on X(Twitter)

Share on Facebook

Add to Hatena Bookmark

More than 5 years have passed since last update.

@hatorijobs(Jobs Hatori)

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
86

Go to list of users who liked

55
0

Go to list of comments

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
86

Go to list of users who liked

55