問題
在git push 的時(shí)候提示輸入賬號(hào)密碼。但我在另一個(gè)項(xiàng)目配置過 ssh 免密的。并且現(xiàn)在 git 也不允許 http 連接,所以提供賬號(hào)密碼也沒辦法 push。
$ git push -u origin main
Username for 'https://github.com': xx@qq.comxx
Password for 'https://xx@qq.com@github.com':
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/balala8/N0va_for_mac.git/'
原因&解決
雖然是用 git 命令push,但本質(zhì)上仍然是 https,所以不允許提交。
使用 git remote -v 查看現(xiàn)在的遠(yuǎn)程 url 地址。
git remote -v
origin https://github.com/balala8/N0va_for_mac.git (fetch)
origin https://github.com/balala8/N0va_for_mac.git (push)
使用下面的改 url 鏈接。
git remote set-url origin git@github.com:balala8/N0va_for_mac.git
再次查看
git remote -v
origin git@github.com:balala8/N0va_for_mac.git (fetch)
origin git@github.com:balala8/N0va_for_mac.git (push)
已經(jīng)改為 ssh 了?,F(xiàn)在可以正常 push 了。
后續(xù)
使用ssh測(cè)試鏈接。
ssh git@github.com
會(huì)發(fā)現(xiàn)文章來源:http://www.zghlxwxcb.cn/news/detail-503962.html
You've successfully authenticated, but GitHub does not provide shell access.
這句話其實(shí)一直存在,它只是想告訴你,github 不允許 shell 交互。僅此而已。文章來源地址http://www.zghlxwxcb.cn/news/detail-503962.html
到了這里,關(guān)于解決You‘ve successfully authenticated, but GitHub does not provide shell access.的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!