繁体   English   中英

Visual Studio 2019 停止推送到 Git

[英]Visual Studio 2019 Stopped Pushing to Git

我有 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它可以工作......

我怎样才能解决这个问题?

检查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"

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

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

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

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

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

如果文件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 并再次尝试推送。

我在 Visual Studio 2022 中遇到了同样的问题,但是在我在我的机器中重新安装 Git 后,Git 开始正常运行(留下下面的链接)。 对我来说,错误显示的路径不存在,当我打开路径 C:/Program Files/Git 时,它是空的。 这是在我在我的机器上卸载 Git 之后发生的,所以这促使我重新安装它。

git下载链接: https ://git-scm.com/download/win

更新我的 Visual Studio 2019 后我遇到了同样的问题。它无法找到文件路径:c:/program files (x86)/microsoft visual studio/2019/community/common7/ide/commonextensions/microsoft/teamfoundation/team explorer/Git /mingw32/bin/ca-bundle.crt

C:\Program Files (x86)\Microsoft Visual Studio\2019中搜索ca-bundle.crt

复制 ca-bundle.crt 并将其粘贴到它要查找的目录中。 如果该目录不存在,则创建c:/program files (x86)/microsoft visual studio/2019/community/common7/ide/commonextensions/microsoft/teamfoundation/team explorer/Git/mingw32/bin并将证书粘贴到其中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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