今までローカルからHerokuにPushしていたアプリを
初めてGitHubに上げることになりました。
https://qiita.com/KentaKodashima/items/16a787779ffecc29e717を参考にしてます。
※1~4の手順は今までHerokuにPushできているので省略しました。
手順5の
git remote add origin ssh://git@github.com:UserName/ProjectName
をしたところ
fatal: remote origin already exists.
というエラーが出力されてGitHubにpushできない状態です。
初歩的な質問で申し訳ありませんがよろしくお願いいたします。
###試したこと
originがすでに存在しているとのことなので
git remote rm origin $ git remote add origin git@github.com:UserName/ProjectName.git $ git push -u origin master
を試したのですが、
$ git push -u origin masterのコマンドのときに
git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
という別のエラーが出力されました。