简体   繁体   English

git push heroku master:错误

[英]git push heroku master: error

I'm uploading a php project on Heroku and I'm following the instructions given on official website. 我在Heroku上上传了一个php项目,并且按照官方网站上的说明进行操作。 When I reach the last command 当我到达最后一条命令时

git push heroku master

I receive the following error: 我收到以下错误:

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.

I've searched around and couldn't find any solution. 我到处搜寻,找不到任何解决方案。

Heroku deploys are managed via git . Heroku部署通过git管理。 Git has a concept called remote repositories ; Git有个叫做远程仓库的概念; that is, repositories stored on another machine. 也就是说,存储库存储在另一台计算机上。 When you git push , you're sending data to one of these remote repositories. 当您使用git push ,您正在将数据发送到这些远程存储库之一。 git push heroku master means "push to the master branch on the remote repository named heroku ." git push heroku master意思是“推送到名为heroku的远程存储库上的master分支”。

You can use the git remote command to view the configured remotes for your repository. 您可以使用git remote命令查看您的存储库配置的远程服务器。 For instance, if you run git remote -v , you'll probably see something like this (you might have others listed too). 例如,如果您运行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 can work with remotes via two protocols: http and ssh . Git可以通过两种协议与远程服务器一起使用: httpssh Your remote is set up to use http (the default for Heroku), but your libcurl library doesn't have support for SSL, which is used for https. 您的遥控器设置为使用http(Heroku的默认设置),但您的libcurl库不支持SSL(用于https)。 That's what your error message means - git can't use https to access its remote. 这就是您的错误消息的意思-git无法使用https访问其远程服务器。

If you've set up SSH keys for your Heroku account you can remove the https remote, and reconfigure it as an ssh remote: 如果您已经为Heroku帐户设置了SSH密钥,则可以删除https遥控器,并将其重新配置为ssh遥控器:

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

You can also use the heroku command to add an ssh remote for you, after removing the old one: 在删除旧的ssh遥控器之后,您还可以使用heroku命令为您添加一个ssh遥控器:

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

The Heroku documentation has more information about using SSH with git remotes . Heroku文档提供了有关将SSH与git remotes一起使用的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM