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

StackOverflow https://stackoverflow.com/questions/23553174

  •  18-07-2023
  •  | 
  •  

Question

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 'git@heroku.com: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?

Était-ce utile?

La solution

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>.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top