代码之家  ›  专栏  ›  技术社区  ›  User987

Visual studio扩展未知错误-无法推送或获取任何内容

  •  13
  • User987  · 技术社区  · 6 年前

    尝试通过Git extension for visual studio将任何内容推送到bitbucket存储库时出错:

    Error encountered while pushing branch to the remote repository: Git failed with a fatal error.
    HttpRequestException encountered.
       An error occurred while sending the request.
    cannot spawn /C/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/Git/mingw32/libexec/git-core/git-askpass.exe: No such file or directory
    could not read Password for ......
    

    有什么问题吗?

    5 回复  |  直到 6 年前
        1
  •  4
  •   Moon    6 年前

    它似乎影响了一些Visual Studio用户 since a few hours ago ,即使在此之前环境没有发生任何变化。显然Git与Visual Studio的集成出了问题。

    当前有一个解决方法,您可以在存储库的远程设置中设置密码,如图所示 here ,但请注意 不安全的 因为它需要用纯文本存储密码。

    另一种解决方法是使用命令行处理Git。

    第三个解决方法,我也找到了最好的一个,是 配置SSH密钥身份验证 . 截至目前,它似乎与Visual Studio 2017协同工作,没有任何问题。这是我选择的解决方案。

        2
  •  16
  •   Vlad Rudenko    6 年前

    原因: 几个月前,GitHub不赞成支持TLS1.0和TLS1.1时也出现了同样的错误消息。现在看来阿特拉斯在2018年8月6日对BitBucket的网络做了一些改变( https://blog.bitbucket.org/2018/08/06/update-ip-migration/ ). 这一变化可能与问题有关。

    解决方法: Visual Studio 2017中捆绑的Git Credential Manager for Windows还不是最新版本。下载最新版本并将其放在Visual Studio 2017中的文件顶部,解决以下问题:

    1. 从下载zip文件gcmw-v1.16.3.zip https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases
    2. 导航到C:\程序文件(x86)\ Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\libexec\(或“缺少的”Git-askpass.exe所在的位置)
    3. 备份git core文件夹
    4. 将zip文件中的文件放在新git core文件夹的内容之上,并在提示时覆盖

    如果配置了远程设置(即更改),似乎还需要从远程设置中删除“登录” https://login@bitbucket.org/myrepo/myproject.git https://bitbucket.org/myrepo/myproject.git )使用Atlassian ID代替完整的电子邮件。

    ( source )

        3
  •  4
  •   VegasGamer    6 年前

    我将此报告为一个bug,因为它在更新到15.7.6之后才开始发生在我身上。

    https://developercommunity.visualstudio.com/content/problem/307355/vs-2017-git-failed-with-a-fatal-error-after-instal.html

        4
  •  1
  •   Matheus Lacerda Fidan Bacaj    6 年前

    现在,我只需在“git克隆url”上设置通行证,就解决了我的问题。

    https://login:pass@bitbucket.org/myrepo/myproject.git

    不过,我仍在寻找更好的解决方案。

        5
  •  0
  •   Duke    6 年前

    1) 删除凭据管理器中的凭据

    2) 重命名或删除 Git目录 在“C:/Program Files(x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/Git”中

    3) 安装软件包“ https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/tag/v1.17.0 "

    4) 当VS请求BitBucket/GitHub凭据时,插入它们