我的公司使用 GitLab,当我尝试使用 Visual Studio 2022 中的 Git UI 推送到远程功能分支时,我在“输出”窗口中收到以下错误:
Git failed with a fatal error.
unable to access '<my gitlab server url>':
schannel: CertGetCertificateChain trust error CERT_TRUST_IS_UNTRUSTED_ROOT"
Run Code Online (Sandbox Code Playgroud)
我尝试了在另一个解决方案中看到的以下命令,git config --global http."<my gitlab server url>.sslCAInfo C:/path/to/cert.pem但它给了我同样的错误。命令中使用的证书是我通过单击挂锁图标和来从 GitLab 服务器下载的View Certificate。
每次我从用户界面推送或拉取时都会发生这种情况。当我使用单独的终端(例如 Git Bash 或 PowerShell)时,不会发生该错误。