【Heroku】’heroku’ does not appear to be a git repositoryエラーの解決策

‘heroku’ does not appear to be a git repositoryエラーの解決方法についてまとめました。

スポンサーリンク

【Heroku】’heroku’ does not appear to be a git repositoryエラー

Herokuで「git push heroku master」を実行すると、以下のエラーが出ることがあります。

$ git push heroku master

fatal: 'heroku' 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.

その場合は、以下のコマンドを実行することで解消されることがあります。

$ git remote add heroku https://git.heroku.com/アプリケーション名.git

これは、.git/configにリモートリポジトリの参照先を追加しています。
なので、gitコマンドを使わずに.git/configで以下のように直接参照先を追記してもいいです。

[remote "origin"]
  url = https://hoge@bitbucket.org/hoge/hoge.git
  fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
  remote = origin
  merge = refs/heads/master
[remote "heroku"]
  url = https://git.heroku.com/<アプリケーション名>.git
  fetch = +refs/heads/*:refs/remotes/heroku/*
【C#入門】基礎文法とサンプル集
C#言語の基本文法・使い方をサンプルプログラムのソースコード付きで解説します。
Heroku
スポンサーリンク

コメント