1. 程式人生 > >[Git]Error: Permission to user/repo denied to other-user

[Git]Error: Permission to user/repo denied to other-user

Error: Permission to user/repo denied to other-user

        曾經使用過一個 github賬號A ,並且添加了 SSH驗證 且好像使用 Token 登入過。後來種種原因,又建立了一個 github賬號B,並且已經添加了 SSH驗證。想利用 IntelliJ IDEA 提交到 github賬號B 倉庫的時候發現出現錯誤:
        remote: Permission to user_B/xxx denied to user_A

臨時解決方案

        登入到原來的賬號 github賬號A ,把原來的 Personal access tokens 刪除。為了成功,我也把原來的 SSH驗證 刪除了。之後,建立 github賬號BSSH驗證。這時會發現,成功的時候顯示的 Hi xxx! 中改為了新的賬號名稱。 然後 push 時就成功了。
        之前也試過,重灌 git 、 **在 控制面板 >> 使用者賬戶 >> 管理我的憑證 中刪除 github

的憑證 **等等,都沒有成功。
        應該通過設定 github賬戶B 中對應 倉庫 的一些許可權也可以【作者不同了】,沒有嘗試。。。