Visual Studio 2019停止推送到Git

时间:2019-12-12 03:17:44

标签: git visual-studio visual-studio-2019

我有VS Community 2019,并且我在Azure DevOps上的Git存储库一切正常。但是VS今天早上更新了,现在由于某种原因它不会推送到Git。看来这一定是问题所在,因为这是自上次推送以来唯一发生的变化。现在,当我尝试推送我的提交时,我得到了:

> Pushing develop Error encountered while pushing to the remote
> repository: Git failed with a fatal error. unable to access
> '<<my repo>>':
> error setting certificate verify locations:   CAfile: c:/program files
> (x86)/microsoft visual
> studio/2019/community/common7/ide/commonextensions/microsoft/teamfoundation/team
> explorer/Git/mingw32/bin/curl-ca-bundle.crt   CApath: none Pushing to
> <<my repo>>

真正奇怪的是,如果我只是在repo目录中执行git bash并使用git push的话...

我该如何解决?

3 个答案:

答案 0 :(得分:1)

如果文件 curl-ca-bundle.crt 不存在于:

c:/program files (x86)/microsoft visual studio/2019/community/common7/ide/commonextensions/microsoft/teamfoundation/team explorer/Git/mingw32/bin/curl-ca-bundle.crt

尝试从本地 git 安装中复制 CRT 文件。

使用命令提示符运行 git config -l --show-origin。查找条目 http.sslcainfo=/ssl/certs/ca-bundle.crt。将文件 ca-bundle.crt 复制到 Visual Studio 目录 ../team explorer/Git/mingw32/bin/ 中并将其重命名为 curl-ca-bundle.crt

重新启动 Visual Studio 并再次尝试推送。

答案 1 :(得分:0)

在所有这些情况下,建议升级Windows版Git凭据管理器。

https://jessehouwing.net/configure-visual-studio-to-use-a-different-git-credential-manager-for-windows/

答案 2 :(得分:0)

在VS更新后检查路径是否仍然有效(仍然存在)

dir "c:/program files (x86)/microsoft visual studio/2019/community/common7/ide/commonextensions/microsoft/teamfoundation/team explorer/Git/mingw32/bin/curl-ca-bundle.crt"

如果有,请在“ curl-ca-bundle.crt”下搜索另一个c:/program files (x86)/microsoft visual studio/,以防更新创建了新的。

还请检查您的git config -l --show-origin仅包含一个条目

http.sslcainfo=/ssl/certs/ca-bundle.crt