使用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 地址錯誤
解決方法:
- 找到你要上傳的項目文件夾,文件夾中會有.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