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