簡體   English   中英

git push heroku master:錯誤

[英]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可以通過兩種協議與遠程服務器一起使用: httpssh 您的遙控器設置為使用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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM