could not read Username for 'https://github.com': No error


用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 格式


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM