出現(xiàn)場景
pull
從github或者gitee碼云拉取其他人的私有項目時,報以下錯誤
git clone https://gitee.com/hybird_now/ali_app.git
Cloning into 'ali_app'...
remote: [session-20433bf4] Access denied
fatal: unable to access 'https://gitee.com/hybird_now/ali_app.git/': The requested URL returned error: 403
push
要把某個項目push到Gitee碼云或者Github上,已經(jīng)設(shè)置了倉庫地址,在最后一步推送代碼時直接報錯。
adodeMacBook-Pro:yimabao ado$ git push --set-upstream origin master
remote: [session-774b45b9] Access denied
fatal: unable to access 'https://gitee.com/mzmilk/yimabao.git/': The requested URL returned error: 403
問題分析
因為報的錯是沒有訪問權(quán)限,只要本地使用過Github或者Gitee等git服務(wù),電腦上就會存儲git的賬號和密碼憑據(jù).這樣下次pull或者push的時候就會默認
我們只要刪除本地賬號或者把git的賬號和密碼修改成遠程倉庫有訪問權(quán)限的賬號即可。
解決方案
Windows
Mac
打開鑰匙串,種類選擇所有項目,在右邊搜索git。
找到github或者gitee,刪除對應(yīng)的項目即可。
刪除
右鍵,點擊刪除"gitee.com"
彈出窗口,選擇刪除。
修改
雙擊gitee條目后,彈出以下窗口。
修改賬戶, 勾選顯示密碼,輸入電腦密碼,然后就能更改密碼了。
最后點擊存儲更改就修改完成了。文章來源:http://www.zghlxwxcb.cn/news/detail-823594.html
再重新pull或者push,會提示輸入密碼和賬號,輸入正確的就能正常pull、push了。文章來源地址http://www.zghlxwxcb.cn/news/detail-823594.html
adodeMacBook-Pro:yimabao ado$ git push --set-upstream origin master
Username for 'https://gitee.com': xxxxxx@qq.com
Password for 'https://xxxxxx@qq.com@gitee.com':
Enumerating objects: 158, done.
Counting objects: 100% (158/158), done.
Delta compression using up to 4 threads
Compressing objects: 100% (136/136), done.
Writing objects: 100% (158/158), 268.65 KiB | 5.97 MiB/s, done.
Total 158 (delta 25), reused 0 (delta 0)
remote: Resolving deltas: 100% (25/25), done.
remote: Powered by GITEE.COM [GNK-6.4]
To https://gitee.com/mzmilk/yimabao.git
* [new branch] master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.
到了這里,關(guān)于解決Gitee或者Github出現(xiàn)Access denied fatal: unable to access,The requested URL returned error: 403的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!