简体   繁体   English

Visual Studio 2019 停止推送到 Git

[英]Visual Studio 2019 Stopped Pushing to Git

I have VS Community 2019 and everything was working fine with my Git repo on Azure DevOps.我有 VS Community 2019,我在 Azure DevOps 上的 Git 存储库一切正常。 However VS updated this morning and now for some reason it won't push to Git.然而 VS 今天早上更新了,现在由于某种原因它不会推送到 Git。 It seems like that must be the issue because that's the only thing that changed since the last time I pushed.看来这一定是问题所在,因为这是自我上次推送以来唯一改变的事情。 Now when I try to push my commits I get this:现在,当我尝试推送我的提交时,我得到了这个:

> 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>>

The really odd part is if I just do a git bash at the repo directory and use git push it works...真正奇怪的部分是,如果我只是在 repo 目录中执行 git bash 并使用git push它可以工作......

How can I fix this?我怎样才能解决这个问题?

Check if the path is still valid (still exist) after VS update:检查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"

If it does, search for another curl-ca-bundle.crt under " c:/program files (x86)/microsoft visual studio/ " in case the update created a new one.如果是这样,请在“ c:/program files (x86)/microsoft visual studio/ ”下搜索另一个curl-ca-bundle.crt ,以防更新创建了一个新的。

Check also your git config -l --show-origin includes only one entry还要检查您的git config -l --show-origin仅包含一个条目

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

In all of these cases, the recommendation is to upgrade the Git credential Manager for Windows.在所有这些情况下,建议升级适用于 Windows 的 Git 凭据管理器。

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

If the file curl-ca-bundle.crt doesn't exist in:如果文件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

Try copying the CRT file from your local git installation.尝试从本地 git 安装复制 CRT 文件。

Use command prompt to run git config -l --show-origin .使用命令提示符运行git config -l --show-origin Look for the entry http.sslcainfo=/ssl/certs/ca-bundle.crt .查找条目http.sslcainfo=/ssl/certs/ca-bundle.crt Copy the file ca-bundle.crt into the visual studio directory ../team explorer/Git/mingw32/bin/ and rename it to curl-ca-bundle.crt .将文件ca-bundle.crt复制到 Visual Studio 目录../team explorer/Git/mingw32/bin/并将其重命名为curl-ca-bundle.crt

Restart Visual Studio and try pushing again.重新启动 Visual Studio 并再次尝试推送。

I faced the same issue in Visual Studio 2022, but Git started functioning normally, after I re-reinstalled Git in my machine (leaving link below).我在 Visual Studio 2022 中遇到了同样的问题,但是在我在我的机器中重新安装 Git 后,Git 开始正常运行(留下下面的链接)。 For me, the path displayed in error did not exist and when I opened the path C:/Program Files/Git, it was empty.对我来说,错误显示的路径不存在,当我打开路径 C:/Program Files/Git 时,它是空的。 This was happening after I uninstalled Git in my machine, so that prompted me to re-install it.这是在我在我的机器上卸载 Git 之后发生的,所以这促使我重新安装它。

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

I had the same issue after updating my Visual Studio 2019. It was unable to find filepath: c:/program files (x86)/microsoft visual studio/2019/community/common7/ide/commonextensions/microsoft/teamfoundation/team explorer/Git/mingw32/bin/ca-bundle.crt更新我的 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

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

copy ca-bundle.crt and paste it in the directory where it is looking for it.复制 ca-bundle.crt 并将其粘贴到它要查找的目录中。 If the directory does not exist, create c:/program files (x86)/microsoft visual studio/2019/community/common7/ide/commonextensions/microsoft/teamfoundation/team explorer/Git/mingw32/bin and paste the certificate into it.如果该目录不存在,则创建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