曾經(jīng)我使用SourceTree 鏈接github時(shí)遇到很多煩惱,解決的方法突破口是設(shè)置中的網(wǎng)絡(luò)部分
如今,我連公司的內(nèi)網(wǎng)git倉庫,我發(fā)現(xiàn)SourceTree在Mac電腦上第一次輸錯(cuò)密碼后,以后提交就會始終出現(xiàn)問題。
報(bào)錯(cuò)信息如下:
Pushing to [https://github.com/XXXX/XXX.git](https://github.com/XXXX/XXX.git)
remote: Permission to XXXX/XXX.git denied to hxxx.
fatal: unable to access '[https://github.comXXXX/XXX.git/](https://github.comXXXX/XXX.git/)': The requested URL returned error: 403
或者信息:
[HTTP Basic: Access denied fatal: Authentication failed](https://stackoverflow.com/questions/44514728/http-basic-access-denied-fatal-authentication-failed)
這個(gè)時(shí)候,Stack Overflow上的回答
git config --system --unset credential.helper
這個(gè)方法只適用于windows系統(tǒng),在Mac上執(zhí)行時(shí),要加上sudo 但是這樣依然解決不了問題。
最終的解決方法是:一定要讓sourceTree 讓你重新輸入密碼。此時(shí)你刪除所有用戶賬戶都沒用。除了你刪除keyChain鑰匙串里面保存的密碼?。?!
打開鑰匙串,搜索git.XXXX.com 或者搜索git ,把對應(yīng)的秘鑰都刪掉?。。?br> 然后在進(jìn)行提交,這時(shí)候就會有提示,讓你重新輸入密碼!?。?/p>