Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I got error while using "git push heroku master"

I'm using the below given commands for push data to heroku app.

git clone https://git.heroku.com/bigpro.git
cd bigpro
git add .
git commit . -m "my test on commit" 
git push heroku master

When I used git push heroku master I got something like this..

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.

Then I gave heroku open command, I got an error which is

▸    ENOTFOUND: getaddrinfo ENOTFOUND api.heroku.com api.heroku.com:443

When I got the above error I tried to change commands on terminal by using heroku git:clone -a bigpro and after made my changes, I gave git push heroku master ,I got an error

 remote: ! Push rejected to bigpro. remote: To git.heroku.com/bigpro.git ! 
[remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'git.heroku.com/bigpro.git'; 
like image 342
Andrea Avatar asked Oct 19 '22 03:10

Andrea


2 Answers

First, install the heroku toolbelt, and then type heroku login to setup your account properly.

Next, type heroku git:clone -a myapp where myapp is the name of your application in Heroku. This will pull the repository and setup the remotes correctly for you.

Next, make your changes as usual.

Then you can do git push heroku master

like image 144
Burhan Khalid Avatar answered Oct 21 '22 04:10

Burhan Khalid


This happened to me after I cloned from heroku a second copy of my files. Suddenly git push heroku master wouldn't work and I'd get the same error as you. But when I tried git push origin master, it worked fine.

like image 34
Jon Nardini Avatar answered Oct 21 '22 05:10

Jon Nardini