Why getting error when I am trying to run: git push heroku master

1.3K    Asked by ankurDwivedi in Salesforce , Asked on Jul 12, 2021

I am trying to push nodejs project to Heroku app it failed to push some refs to heroku . The code can be found here: https://github.com/birgirp/thehole.

The error I get is the following: $ git push heroku master Enumerating objects: 494, done. Counting objects: 100% (494/494), done. Delta compression using up to 4 threads Compressing objects: 100% (220/220), done. Writing objects: 100% (494/494), 6.10 MiB | 538.00 KiB/s, done. Total 494 (delta 231), reused 485 (delta 227) remote: Compressing source files... done. remote: Building source: remote: remote: ! No default language could be detected for this app. remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically. remote: See https://devcenter.heroku.com/articles/buildpacks remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to thehole. remote: To https://git.heroku.com/thehole.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/thehole.git' Any ideas what might be causing the error?


Answered by Amelia Arnold

This error means that the master branch on Heroku contains commits that are not in your local branch. Or, if you don't care about the missing commits you can force push to Heroku. This will overwrite the remote repo on Heroku with your local commits. You probably have not checked out master first. In order to resolve this you would have to make sure you are on the same branch and your local repo is up to date. check: git checkout master git pull git push origin master



Your Answer

Interviews

Parent Categories