我目前在 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/