用idea往github上push代碼的時候,突然的不能用了。
報could not read Username for 'https://github.com': No error錯誤。
原因不明。
解決
1、進入項目目錄
2、進入 .git 目錄
3、修改.git/config 文件
把github的賬號密碼直接寫死在url中
不知道為什么以前可以推送,最近git push origin master報錯
error: cannot spawn askpass: No such file or directory
fatal: could not read Username for ‘https://github.com‘: terminal prompts disabled
Pushing to https://github.com/…..
發布到遠程存儲庫時遇到錯誤: Git failed with a fatal error.
發現通過以下設置可以解決推送錯誤的問題
修改推送的url為如下:
git remote add origin https://{username}:{password}@github.com/{username}/project.git
如:https://github.com/zhangsan:123456@github.com/zhangsan/project.git
或者直接修改 .git/config 隱藏文件 為git remote add origin https://{username}:{password}@github.com/{username}/project.git 格式