問(wèn)題復(fù)現(xiàn)
你在切換多個(gè)github賬號(hào)的時(shí)候宇色,很容易出現(xiàn)下面的這種問(wèn)題
問(wèn)題描述
今天我在使用git push 將修改的項(xiàng)目push到github中戚扳,出現(xiàn):
remote: Permission to xxxxx.git denied to xxx.fatal: unable to access 'https://github.com/ xxxxx.git/': > The requested URL returned error: 403
解決方案
第一步仙逻,將github中的項(xiàng)目clone下來(lái)
第二步,修改.git/cofig中的url
cd 到項(xiàng)目中,編輯 .git/cofig中的url
vim .git/config
將
[remote "origin"]
url = https://github.com/git的用戶名/項(xiàng)目名稱
的url改為
url = https://appleyuchi@github.com/appleyuchi/TPU_GPU_Code.git
第三步谆吴,git push -u origin master
這里附帶記錄一個(gè)小命令:
git config --list