我们正在将heroku堆栈从18升级到22。在我们尝试重新部署应用程序时点击升级后,我们在进行git推送时收到以下错误:
error: src refspec master does not match any
error: failed to push some refs to 'https://git.heroku.com/test.git'
我们正在按照以下步骤重新部署:
$heroku git:clone-一个测试
$cd测试
$git添加。
$git commit-am"让它变得更好";
$git推送heroku主
此外,我们还从CLI和中遵循了以下步骤
要通过Heroku CLI升级,请在生产应用程序上使用stack:set命令:
heroku堆栈:设置heroku22-一个测试将堆栈设置为heroku-22…已完成您需要重新部署⬢以便更改生效。运行git-push-heroku-main以触发新的构建⬢ .
git-commit—允许空-m";升级到heroku-22";
[master (root-commit) 89fea09] Upgrading to heroku-22
gitpush heroku主
Enumerating objects: 2, done.
Counting objects: 100% (2/2), done.
Writing objects: 100% (2/2), 185 bytes | 185.00 KiB/s, done.
Total 2 (delta 0), reused 0 (delta 0), pack-reused 0
remote: error: pathspec '.' did not match any file(s) known to git.
remote:
remote: ! Heroku Git error, please try again shortly.
remote: ! See http://status.heroku.com for current Heroku platform status.
remote: ! If the problem persists, please open a ticket
remote: ! on https://help.heroku.com/tickets/new
remote:
To https://git.heroku.com/test.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/test.git'
bhattacharjee.c@bhattac-ltmynzq ei-mule-dashboard-ee1 % git push heroku main
error: src refspec main does not match any
error: failed to push some refs to 'https://git.heroku.com/test.git'.
我们在这里得到以下错误:
remote: error: pathspec '.' did not match any file(s) known to git.
remote:
remote: ! Heroku Git error, please try again shortly.
remote: ! See http://status.heroku.com for current Heroku platform status.
remote: ! If the problem persists, please open a ticket
remote: ! on https://help.heroku.com/tickets/new
远程:
To https://git.heroku.com/test.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/test.git'
bhattacharjee.c@bhattac-ltmynzq ei-mule-dashboard-ee1 % git push heroku main
error: src refspec main does not match any
error: failed to push some refs to 'https://git.heroku.com/test.git'.
你能帮我们重新研究一下这个问题吗。
我们按照以下步骤重新部署:
$ heroku git:clone -a test
首先,你不应该这样做:
Heroku应用程序的Git存储库仅用于部署目的。从该存储库进行克隆不是官方支持的功能,只能作为最后手段尝试请勿将此存储库用作应用程序的规范"原始"存储库。相反,使用您自己的Git服务器或GitHub等版本控制服务。
如果这是您常规工作流程的一部分,请进行相应调整。Heroku不是一个源代码管理平台。
现在,谈谈问题:
src refspec master does not match any
您根本没有master
分支。
Heroku从两个分支之一构建:main
(更新并慢慢成为社区标准的默认分支名称(和master
(遗留(。
如果你没有master
分支,你几乎可以肯定有一个main
分支,Heroku很乐意从中构建:
git push heroku main
如果你需要从其他分支another-branch
部署,你仍然需要在Heroku:上推送到main
(或master
(
git push heroku another-branch:main
最后,请不要实际使用";让它变得更好";作为提交消息。花些时间使承诺信息清晰而有意义。关于如何做到这一点,有很多好的建议。