解決git push 中remote: Permission to xxxxx.git denied to xxx. fatal: unable to access 'https://github.com/ xxxxx.git/':URL .......


使用git push -u origin master 命令時 出現 :

remote: Permission to gavincook/test.git denied to kase-ding.
fatal: unable to access 'https://github.com/gavincook/test.git/': The requested URL returned error: 403

出現這個提示是因為沒有訪問權限,要么登錄了兩個賬戶,要么就是config中的url 地址錯誤

解決方法:

  1. 找到你要上傳的項目文件夾,文件夾中會有.git文件,如果已經git init 沒有看到 .git 文件,

點 查看 勾選 隱藏的項目:

打開.git文件中的config文件,編輯 .git/config中的url:

將config中的url中的

[remote "origin"]
url = https://github.com/git的用戶名/項目名稱
的url改為
url = https://git的用戶名@github.com/git的用戶名/項目名稱

參考:https://www.cnblogs.com/angel648/p/13366030.html?utm_source=tuicool


免責聲明!

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



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