[英]git push heroku master: error
我在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.
我到处搜寻,找不到任何解决方案。
Heroku部署通过git管理。 Git有个叫做远程仓库的概念; 也就是说,存储库存储在另一台计算机上。 当您使用git push
,您正在将数据发送到这些远程存储库之一。 git push heroku master
意思是“推送到名为heroku
的远程存储库上的master
分支”。
您可以使用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访问其远程服务器。
如果您已经为Heroku帐户设置了SSH密钥,则可以删除https遥控器,并将其重新配置为ssh遥控器:
git remote rm heroku
git remote add heroku git@heroku.com:hidden-hamlet-3511.git
在删除旧的ssh遥控器之后,您还可以使用heroku
命令为您添加一个ssh遥控器:
git remote rm heroku
heroku git:remote -a hidden-hamlet-3511 --ssh-git
Heroku文档提供了有关将SSH与git remotes一起使用的更多信息 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.