1. 程式人生 > >git推送代碼Gogs報401錯誤

git推送代碼Gogs報401錯誤

inf 技術 alt 失敗 remote gogs rem bsp quest

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

2.原因:用戶名和密碼輸錯,導致驗證不通過,沒有權限推送

3.解決:

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

git remote rm origin

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

git remote add origin http://[email protected]:3000/xxx/xxx_xx.git

技術分享圖片

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

git remote -v

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

git推送代碼Gogs報401錯誤