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?
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.
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.
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.
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>.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With