错误:源参考规范master不匹配任何内容。无法将一些参考推送到Heroku。

5
我正在一个分支上工作,并将该分支仅推送到Heroku。我一直在这样做。
git push heroku master branchname:master 

自昨天起,这个功能一直出现故障。

一直出现这两个错误。

error: src refspec master does not match any.
error: failed to push some refs to 'git@heroku.com:repo.git'

我尝试过

git pull heroku master 

收到了

 * branch            master     -> FETCH_HEAD

然后再做另一个。
git push heroku master branchname:master 

我仍然遇到相同的错误。

已经尝试过:

git push -f heroku master branchname:master

这可能是一个git问题。我在把代码推送到bitbucket时没有遇到麻烦。
我读了一些stackoverflow上的问题/答案,但它们都处理github而不是heroku?
1个回答

9
似乎您正在尝试做的是:

git push heroku master

如果您当前在分支名称上,则“or”表示相同的含义。
git push heroku branchname:master

来自man手册:

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>.

2
我应该执行 git push heroku branchname:master 而不是 git push heroku master branchname:master - Jngai1297

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接