fatal: 'heroku' does not appear to be a git repository

  • Question
  • Updated 1 year ago
"git push heroku master " results in "fatal: 'heroku' does not appear to be a git repository" How do I push to heroku?
Photo of hone

hone, Official Rep

  • 37 Posts
  • 3 Reply Likes

Posted 5 years ago

  • 3
Photo of hone

hone, Official Rep

  • 37 Posts
  • 3 Reply Likes
This is because there's no remote named heroku. When you do a heroku create, if the git remote doesn't already exist, we automatically create one (assuming your in a git repo). You can see you remotes by typing "git remote -v". For my 'herocutter' app I see the following:

$ git remote -v
heroku git@heroku.com:herocutter.git (fetch)
heroku git@heroku.com:herocutter.git (push)

If you see a remote for your app, you can just "git push master" and replace with the actual remote name.

If it's missing, you can add the remote with the following command:

git remote add heroku git@heroku.com:.git

where is the name of your heroku app.
Photo of Shweta Nair

Shweta Nair

  • 1 Post
  • 0 Reply Likes
what if i get my heroku app listed when i do
$ git remote -v
and still get the error
Photo of Evan

Evan

  • 1 Post
  • 7 Reply Likes
This should be

git remote add heroku git@heroku.com:appname.git

Where appname is the name of your app.

Then: git push heroku master (assuming you want to push the master branch)
Photo of George Ulmer

George Ulmer

  • 1 Post
  • 0 Reply Likes
It worked. Thanks!!!
Photo of sdegermarkS

sdegermark

  • 1 Post
  • 0 Reply Likes
Thank you... helped me!
Photo of pollo2007P

pollo2007

  • 1 Post
  • 0 Reply Likes
Gracias
Photo of Vusi Ben Noah

Vusi Ben Noah

  • 1 Post
  • 0 Reply Likes
Thank you for this. It helped a little
Photo of Juanma Fernandez

Juanma Fernandez

  • 1 Post
  • 0 Reply Likes
It's a right way! and works with Heroku.
Thanks from Corrientes, Argentina.
Photo of jim.mckercharJ

jim.mckerchar

  • 1 Post
  • 0 Reply Likes
Cheers Evan & Hone. Had this exact same problem after following the heroku setup guide and your answers solved the problem!!
Photo of Doug Stewart

Doug Stewart

  • 1 Post
  • 0 Reply Likes
Great answer! Thanks.
Photo of HowisH

Howis

  • 1 Post
  • 0 Reply Likes
if I accidentally added it as heroku git@heroku.com:.git without the user name, how do I rename or remove it?
Photo of Prateek Narang

Prateek Narang

  • 1 Post
  • 0 Reply Likes
git remote rm heroku
Photo of Robert

Robert

  • 1 Post
  • 0 Reply Likes
go into .git/config and make necessary changes
Photo of Dave S

Dave S

  • 1 Post
  • 0 Reply Likes
Robert, I entered this but this is what happened: .git/config: Permission denied....How do I adjust the permissions? As I would with any file/directory? Thanks!
Photo of rafi.dudekulaR

rafi.dudekula

  • 1 Post
  • 0 Reply Likes
You may remove it using the following command:
git remote rm heroku

Then add it back using the following command:
git remote add heroku git@heroku.com:YourAPPNAME.git
Photo of Michelle

Michelle

  • 1 Post
  • 0 Reply Likes
This is what I got when I followed your instructions:

Warning: Permanently added the RSA host key for IP address '50.19.85.132' to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly.

Now what?
Photo of Jeremy CherfasJC

Jeremy Cherfas

  • 1 Post
  • 0 Reply Likes
Me too!
Photo of Vezu Sigidi

Vezu Sigidi

  • 1 Post
  • 0 Reply Likes
Then you need to follow this https://devcenter.heroku.com/articles...
Photo of AIME NGONGANGAN

AIME NGONGANG

  • 1 Post
  • 0 Reply Likes
i have a question regarding the name of the app. is "appname" here first_app or "appname" the random name thats given to me when i do heroku create?
Photo of Andrés Yepes

Andrés Yepes

  • 1 Post
  • 0 Reply Likes
when you execute "heroku create" he randomly select a name. So the answer to your question is yes.

you can execute "heroku create myAppName"
Photo of D. BrownDB

D. Brown

  • 2 Posts
  • 0 Reply Likes
I've done followed these instructions, including removing the app and then a new heroku create. If I run

git remote -v

I see a fetch and a push line that look logical.

but now:

git push master yields:

! Invalid path
! Syntax is: git.heroku.com:.git where is your app's name.
Fatal: could not read from remote repository.

I know that I'm logged in.

Any ideas? I'm just trying to do Michael Hartl's tutorial

Dave
Photo of D. BrownDB

D. Brown

  • 2 Posts
  • 0 Reply Likes
I started out with the same problem, it just seems to have evolved...
-Dave