Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: src refspec master does not match any. failed to push some refs to heroku

Tags:

git

heroku

I am working on a branch and pushing that branch only to heroku.

I have been doing

git push heroku master branchname:master 

this has been malfunctioning since yesterday

keeps on getting these two errors

error: src refspec master does not match any.
error: failed to push some refs to '[email protected]:repo.git'

have tried

git pull heroku master 

got this

 * branch            master     -> FETCH_HEAD

then do another

git push heroku master branchname:master 

and still getting the same errors

have tried

git push -f heroku master branchname:master

This may be a git issue. I don't have trouble pushing to bitbucket.

I read a couple of the questions/answers on stackoverflow but they are all dealing with github but not with heroku?

like image 342
Jngai1297 Avatar asked May 08 '14 21:05

Jngai1297


People also ask

How do I fix error SRC Refspec master does not match any Heroku?

The solution to this error is to either create a local and remote master branch that you can push the commit to or to push the commit to an existing branch – maybe main . These commands will create a master branch locally. And by pushing to origin master , the master branch will also be created remotely.

What does error SRC Refspec main does not match any mean?

The “src refspec master does not match any” error occurs if you have forgotten to add the files you have changed to a commit and try to push those changes to a remote repository before you make the first commit in your repository.

How do I push a branch to Heroku?

To deploy your app to Heroku, use the git push command to push the code from your local repository's main branch to your heroku remote. For example: $ git push heroku main Initializing repository, done.


1 Answers

It seems that what you are trying to do is

git push heroku master

or, meaning the same if you are currently on branchname

git push heroku branchname:master

From manpage:

git push [repository [refspec...]]

refspec...

   Specify what destination ref to update with what source object. The format of a <refspec> parameter is an optional
   plus +, followed by the source object <src>, followed by a colon :, followed by the destination ref <dst>.
like image 107
Innot Kauker Avatar answered Sep 23 '22 12:09

Innot Kauker