備忘錄: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