推送到 Heroku 时无法从远程存储库读取(Rails 教程 5)

2024-01-28

我将 Sample_App 的第 5 章版本推送到 git,然后当我“git push heroku”时,我得到:

warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:

git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

git config --global push.default simple

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)


!  No such app as sample_app.

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我已经阅读了一些类似的 stackoverflow 问题,所以我知道要查看“git remote -v”:

heroku  [email protected] /cdn-cgi/l/email-protection:sample_app.git (fetch)
heroku  [email protected] /cdn-cgi/l/email-protection:sample_app.git (push)
origin  [email protected] /cdn-cgi/l/email-protection:jeffbenner/sample_app.git (fetch)
origin  [email protected] /cdn-cgi/l/email-protection:jeffbenner/sample_app.git (push)

我尝试删除 heroku 并重新推送 - 我收到相同的错误消息。

我查看了“git config -l”:

user.name=jeffbenner
[email protected] /cdn-cgi/l/email-protection
alias.co=checkout
push.defaults=simple
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=false
[email protected] /cdn-cgi/l/email-protection:jeffbenner/sample_app.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
[email protected] /cdn-cgi/l/email-protection:sample_app.git
remote.heroku.fetch=+refs/heads/*:refs/remotes/heroku/*

我不明白为什么我不能推送到 Heroku。我已经通过 CLI 重新登录了我的 Github 和 Heroku 帐户。任何方向将不胜感激。


我刚刚遇到了同样的问题。我做了以下事情:

cd .git
vim config

删除了所有引用 Heroku 的行

cd ..
heroku create
git push heroku master

...瞧,它成功了。

希望这有帮助。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

推送到 Heroku 时无法从远程存储库读取(Rails 教程 5) 的相关文章

随机推荐