git - 更新后在 Visual Studio 2017 中使用 GIT 时出现错误

标签 git visual-studio-2017

我目前在 Visual Studio 2017 上推送 GIT 提交时遇到此错误。

Error: cannot spawn /C/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/Git/mingw32/libexec/git-core/git-askpass.exe: No such file or directory Error encountered while pushing to the remote repository: Git failed with a fatal error. could not read Username for 'https://**********.visualstudio.com': terminal prompts disabled Pushing to https://**********.visualstudio.com/projectlocationhere

在发生此错误之前,我会收到一个 pop 框,要求我输入用户名和密码,然后它会停止并显示错误消息。

我之前遇到过这个错误,我端到端地搜索了互联网试图找到修复方法,我更改了所有 git 设置,重新安装了 GIT,“修复”了 Visual Studio 安装。同时GIT在VS2015上运行良好。最终解决这个问题的唯一方法是重新安装 VS2017。

我相信这完全是由 Visual Studio 2017 而不是 GIT 造成的,在我将 Visual Studio 更新到最新版本后,这个错误再次出现。我现在正在寻找解决此问题的方法,该解决方案不需要每次需要最新更新时都重新安装 Visual Studio。

我怀疑这与访问 token 有关?我从凭据管理器中删除了凭据,但它没有提示我创建新凭据。

最佳答案

我已经设法让它再次工作。

我在 Visual Studio Online 中创建了一个新的个人访问 token ,并将其添加到 Windows 凭据管理器中。

然后在我的 c:/users/USERNAME/.gitconfig 中我将助手更改为:

[credential]
    helper = wincred

它现在似乎有效,希望如果这种情况再次发生,这将解决它,如果没有,如果没有其他人首先找到它,我会更新这个答案。

关于git - 更新后在 Visual Studio 2017 中使用 GIT 时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51304450/

相关文章:

.net - 在 csproj 文件中多目标时构建错误

git - 由于 Adob​​e Brackets 中的 Git 而丢失所有文件

svn - 如何使用 Git 作为内容分发网络

git - 在 Git 历史记录中查找文件的哈希值

javascript - Visual Studio ReSharper - 在外部模块中声明的 Typescript 自动导入类 - 使用 from 而不是 require

visual-studio-2017 - 有没有 .editorconfig GUI 编辑器?

c# - Visual Studio 2017 15.3 简化空检查

git - 在 git svn clone 中使用 --no-metadata 有优势吗?

ios - 将 git head count 添加到 CFBundleVersion

c# - 在 VS2017 社区创建一个新的 "Website Project"