原因: github禁用了TLS1.0/1.1協議
截至2018年2月22日,GitHub禁用了對弱加密的支持,這意味着許多用戶會突然發現自己無法使用Git for Windows進行身份驗證(影響版本低於v2.16.0)。不要恐慌,有一個修復。將Git for Windows更新到最新版本(或至少v2.16.0)。
用戶看到的最常見的錯誤如下所示:
fatal: HttpRequestException encountered. An error occurred while sending the request. fatal: HttpRequestException encountered. An error occurred while sending the request. Username for 'https://github.com':
Windows的Git憑證管理器(GCM)為Windows提供安全的Git憑證存儲
要使用GCM,您可以下載最新的安裝程序。要安裝,請雙擊Setup.exe,然后按照提供的說明進行操作。
當提示選擇Git Bash的終端仿真器時,應該選擇Windows的默認控制台窗口,或者確保GCM 配置為使用模態對話框。在MinTTY設置中,GCM無法在控制台提示您輸入憑據。
鏈接地址:https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.14.0 本人使用的是1.140 這個版本,個人使用可以選擇最新版本