git push heroku master:错误

时间:2014-12-26 07:42:28

标签: php git heroku

我正在Heroku上传一个php项目,我按照官方网站上的说明进行操作。当我到达最后一个命令时

git push heroku master

我收到以下错误:

error: protocol https not supported or disabled in libcurl while accessing https://git.heroku.com/hidden-hamlet-3511.git/info/refs?service=git-receive-pack 
fatal: HTTP request failed.

我四处寻找,找不到任何解决方案。

1 个答案:

答案 0 :(得分:0)

Heroku部署通过git进行管理。 Git有一个名为远程存储库的概念;也就是说,存储在另一台机器上的存储库。当您git push时,您正在向其中一个远程存储库发送数据。 git push heroku master表示“推送到名为master的远程存储库上的heroku分支。”

您可以使用git remote命令查看存储库的已配置遥控器。例如,如果您运行git remote -v,您可能会看到类似的内容(您可能还会列出其他内容)。

user@host dir$ git remote -v
heroku      https://git.heroku.com/hidden-hamlet-3511.git (push)
heroku      https://git.heroku.com/hidden-hamlet-3511.git (fetch)

Git可以通过两种协议使用遥控器: http ssh 。您的远程设置为使用http(默认为Heroku),但您的libcurl库不支持SSL,后者用于https。这就是您的错误消息的含义 - git无法使用https访问其远程。

如果你set up SSH keys for your Heroku account,你可以删除https遥控器,并将其重新配置为ssh遥控器:

git remote rm heroku
git remote add heroku git@heroku.com:hidden-hamlet-3511.git

您还可以使用heroku命令为您添加ssh遥控器,删除旧遥控器后:

git remote rm heroku
heroku git:remote -a hidden-hamlet-3511 --ssh-git

Heroku文档有more information about using SSH with git remotes

相关问题