备忘录:VS中使用Git报错


shanzm-2020年7月7日

1.问题

VS2019使用Git将代码推送远程仓库时弹出Github的输入用户名和密码的窗口,
在我输入用户名和密码后,显示未推送成功,
输出窗口内容如下:

正在推送 master
发布到远程存储库时遇到错误: Git failed with a fatal error.
TaskCanceledException encountered.
   ��ȡ��һ������
cannot spawn /c/program files (x86)/microsoft visual studio/2019/enterprise/common7/ide/commonextensions/microsoft/teamfoundation/team explorer/Git/mingw32/libexec/git-core/git-askpass.exe: No such file or directory
could not read Username for 'https://github.com': terminal prompts disabled
Pushing to https://github.com/shanzm/ASP.NET-Core.git

2. 解决方案

修改仓库的.git文件夹中的config文件,将文件中的:

url = https://github.com/shanzm/ASP.NET-Core.git

修改为:

url = https://用户名:密码@github.com/shanzm/ASP.NET-Core.git

再次推送,显示成功,完美解决问题!


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM