LoginSignup
0
0

More than 3 years have passed since last update.

git remote add originをスペルミスした時の対処リモートリポジトリに情報を反映できない

Posted at

Git学習時のエラー解決方法(備忘録)

・作業内容

ローカルリポジトリにリモートリポジトリの情報を付与して、紐づけを行う

git remote add orijin コピーしたURL

orijinが紐づけられていることを確認

git remote
orijin

リモートリポジトリ(origin)に情報を反映すると・・・

git push origin master

なんかエラーでてる・・・

fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

このエラーを翻訳すると
fatal: 'origin'はgitリポジトリではないようです
fatal: リモートリポジトリから読み取れませんでした。
正しいアクセス権があり、リポジトリが存在することを確認してください。

あれ?リポジトリ登録したよなと思い登録内容を確認

git remote -v
orijin  https://github.com/〇〇.git (fetch)
orijin  https://github.com/〇〇.git (push)

originではなくorijinになっていました。(スペルミス)

・修正作業内容
登録されているリポジトリからorijinを取り消し

git remote rm orijin

何も登録されていないことを確認して再度originをリポジトリに登録することで解決しました。

git remote -v
git remote add orijin コピーしたURL

参考にさせていただいた記事
【git remote add を取り消す方法】
https://qiita.com/ngtkk/items/05097d127db6a415a7d8

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