简体   繁体   中英

git push heroku master: error

I'm uploading a php project on Heroku and I'm following the instructions given on official website. 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 . Git has a concept called remote repositories ; that is, repositories stored on another machine. When you git push , you're sending data to one of these remote repositories. git push heroku master means "push to the master branch on the remote repository named heroku ."

You can use the git remote command to view the configured remotes for your repository. For instance, if you run git remote -v , you'll probably see something like this (you might have others listed too).

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 . 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. That's what your error message means - git can't use https to access its remote.

If you've set up SSH keys for your Heroku account you can remove the https remote, and reconfigure it as an ssh remote:

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:

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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