【问题标题】:"git push" failing on Heroku\"git push\" 在 Heroku 上失败
【发布时间】:2023-01-31 17:43:44
【问题描述】:

我想看看如何第一次在 Heroku 应用程序上使用 React

我遵循了这些教程: https://www.bacancytechnology.com/blog/deploy-react-app-on-heroku https://stackabuse.com/how-to-deploy-a-react-app-to-heroku/

到最后,我在运行命令时遇到了以下问题:git push heroku 主

我做了两次试验,每次都有同样的问题。我不记得以前见过这个。处理这种情况的方法是什么?

remote: Verifying deploy...
remote: 
remote: !   Push rejected to testapp.
remote: 
To https://git.heroku.com/testapp.git
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/testapp.git'
me@My-MacBook testapp %

【问题讨论】:

标签: reactjs git heroku


【解决方案1】:

预接收挂钩已拒绝

表示该分支受到直接推送保护,或者您没有推送到该分支的权限。如果它是您自己的项目,您可以在存储库的设置中更改它。如果它是一个团体/公司项目,您可能想四处询问权限/访问权限。

因为它叫做 main,所以我假设该分支对整个项目很重要。您可能想要提出拉取请求,然后让您的同行审查并批准它。

或者,如果您自己在沙盒环境中对此进行测试,您可以强制推送

git push -f heroku main

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-09-05
    • 2013-03-21
    • 1970-01-01
    • 2021-05-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-09
    相关资源
    最近更新 更多