[英]Failure to push. Unknown SSL protocol error in connection to github.com:443
I am a new Git/GitHub Windows user. 我是Git / GitHub Windows的新用户。 Using a fresh install of git and following a Lynda.com tutorial instructions, I have created the GitHub repo, generated the ssh, added the ssh key to my GitHub account,and authenticated the connection to GitHub. 使用全新安装的git并遵循Lynda.com教程的说明,我创建了GitHub存储库,生成了ssh,将ssh密钥添加到了我的GitHub帐户,并验证了与GitHub的连接。
When I try to push, I receive the error: 当我尝试推送时,收到错误消息:
Unknown SSL protocol error in connection to github.com:443
I have thoroughly perused StackOverflow and found similar questions, but I am unable to resolve a solution that works for me. 我已经仔细研究过StackOverflow并发现了类似的问题,但是我无法解决适合我的解决方案。 I have posted the relevant git commands below. 我已经在下面发布了相关的git命令。 Any help is appreciated. 任何帮助表示赞赏。
owner@LAPTOP-0FP78GPS /c/users/owner/Documents/explore_california (master)
$ git remote add origin https://github.com/PrinceHumperdinck/explore_california.git
owner@LAPTOP-0FP78GPS /c/users/owner/Documents/explore_california (master)
$ git remote
origin
owner@LAPTOP-0FP78GPS /c/users/owner/Documents/explore_california (master)
$ git push -u origin master
fatal: unable to access 'https://github.com/PrinceHumperdinck/explore_california.git/': Unknown SSL protocol error in connection to github.com:443
owner@LAPTOP-0FP78GPS /c/users/owner/Documents/explore_california (master)
$ ls -al ~/.ssh
total 18
drwxr-xr-x 1 owner Administ 0 Aug 6 14:07 .
drwxr-xr-x 1 owner Administ 28672 Aug 10 11:57 ..
-rw-r--r-- 1 owner Administ 3326 Aug 10 10:51 id_rsa
-rw-r--r-- 1 owner Administ 749 Aug 10 10:51 id_rsa.pub
-rw-r--r-- 1 owner Administ 1226 Aug 6 23:47 known_hosts
owner@LAPTOP-0FP78GPS /c/users/owner/Documents/explore_california (master)
$ ssh -T git@github.com
Hi PrinceHumperdinck! You've successfully authenticated, but GitHub does not provide shell access.
owner@LAPTOP-0FP78GPS /c/users/owner/Documents/explore_california (master)
$ git version
git version 1.9.4.msysgit.2
There are two main ways to access a Git-based source control service such as GitHub or GitLab, is through HTTPS or SSH. 通过HTTPS或SSH访问基于Git的源代码控制服务(例如GitHub或GitLab)的主要方法有两种。 At the moment you're using the HTTPS method which requires you to authenticate every Fetch, Push or Pull request with your username and password. 目前,您正在使用HTTPS方法,该方法要求您使用用户名和密码对每个Fetch,Push或Pull请求进行身份验证。 That's why you get this error. 这就是为什么您会收到此错误。
How to fix 怎么修
Since you have added your SSH key to the GitHub account: 由于您已将SSH密钥添加到GitHub帐户,因此:
git@github.com:PrinceHumperdinck/explore_california.git
复制链接,它应该看起来像这样git@github.com:PrinceHumperdinck/explore_california.git
git remote set-url ORIGIN git@github.com:PrinceHumperdinck/explore_california.git
. 转到本地副本(文件夹)并运行此git remote set-url ORIGIN git@github.com:PrinceHumperdinck/explore_california.git
。 Substitute ORIGIN with the value before the URL of this command git remote -v
用此命令的URL之前的值替换ORIGIN git remote -v
git fetch
and if that works. 运行git fetch
,如果可行。 Run git push
. 运行git push
。 If step 4 doesn't work for you, you can always clone it again with git clone git@github.com:PrinceHumperdinck/explore_california.git
如果第4步对您不起作用,您始终可以使用git clone git@github.com:PrinceHumperdinck/explore_california.git
再次克隆它。
Side note, if you're not familiar with command line GIT you can use GUI tools like Sourcetree for free or GitKraken free for personal use (with annoying popup box) 旁注,如果您不熟悉命令行GIT,则可以免费使用GUI工具(例如Sourcetree)或免费使用GitKraken (供个人使用)(带有令人讨厌的弹出框)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.