git推送代碼Gogs報401錯誤


1.git push 報錯:RPC failed; HTTP 401 curl 22 The requested URL returned error: 401 The remote end hung up

2.原因:用戶名和密碼輸錯,webstorm會記住git賬號密碼(即使是錯誤的賬號和密碼),導致驗證不通過,沒有權限推送

3.解決:

(1)刪除原始遠程數據源:

git remote rm origin

(2)重新添加遠程數據源,即在http后面,git前面加上用戶名@(shenyf@):

git remote add origin http://shenyf@git.intra.xxx-view.cn:3000/xxx/xxx_xx.git

(3)查看此時遠程數據源,已經添加成功:

git remote -v

(4)此時再執行push操作,會重新提示輸入用戶名和密碼,輸入正確用戶名和密碼即可,若輸錯,仍然不提示,依舊顯示推送失敗


免責聲明!

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



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