我只是想连接到我的GitHub账户。当我这样做的时候,我得到这个错误消息作为一个小红色弹出在页面的右上角:

无法检索项目,内部服务器错误。


当前回答

关于这个问题有一个更新。你现在可以像更新中提到的那样启用GitHub集成。

如果它不起作用,你可以尝试删除应用程序到GitHub的连接(断开连接),然后重新添加连接。再次添加连接也可以在隐身模式下完成,因为有时会出现与cookie相关的问题(此处提到)。

其他回答

对于那些将此集成用于部署目的的人,我建议您在这里使用部署到Heroku GitHub操作:

部署到赫鲁库

这样,您就不必对部署工作流进行重大更改。

如果在尝试推送时出现错误,可能是因为开发和部署的分支名称不同。在这种情况下,请遵循下面的说明;

如果你在一个分支上开发,并通过Git进行部署,你必须运行: Git推送heroku <你在>上开发的分支名:<你从>部署的分支名

本文将详细介绍这种行为:

检测到重复的构建版本

我使用的是2014年macOS 11.6.5 (Big Sur)版本的MacBook Pro

brew tap heroku/brew && brew install heroku

我得到一个错误和消息更新到最新的Xcode。最新的Xcode需要最新的macOS,而我无法升级到最新的macOS(我需要2015年的MacBook Pro或更新的版本)。对于一台2014年的MacBook Pro,我能够安装Xcode_13.2.1。Xip,并能够运行。现在我可以向Heroku推送最新消息了。

brew tap heroku/brew && brew install heroku

我也有同样的问题。我已经安装了cli。

git remote

输出:

heroku
origin

git remote -v

输出:

heroku  https://git.heroku.com/YOUR-APP.git (fetch)
heroku  https://git.heroku.com/YOUR-APP.git (push)
origin  https://github.com/GitUserName/yourRepo.git (fetch)
origin  https://github.com/GitUserName/yourRepo.git (push)

如果您的分支名为main,请使用Git分支进行验证。例如,你会这样做:

git push heroku main

对我来说是

git push heroku master

现在推动您的本地更改

git push heroku master

输出:

To https://git.heroku.com/YOUR-APP.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://git.heroku.com/YOUR-APP.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

我不在乎它和遥控器有什么不同。我一直在本地开发,并没有意识到自动Git部署已经失败了。我关心的是局部的变化:

git push heroku master -f

现在部署的应用程序正按预期工作。

这只是一个暂时的事情,关于这个问题的更多细节在这里。

你可以同时推送到GitHub和Heroku,以获得临时解决方案:

git push -u origin <branch>
git push heroku <branch>