背景
由於一些zz行為,在開發的中途更改了本地的一些git信息設置。導致最終想提交代碼時,Git 執行 git push 報錯如下:
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'http://localhost/repo.git/'
1
2
問題原因
賬號密碼驗證不通過,密碼或者權限不對,導致 Git 操作失敗。
解決方案
在本地倉庫路徑內輸入:
git config --system --unset credential.helper
1
再次進行 Git 操作,輸入正確的用戶名,密碼即可。