Git SSH 传输问题
SSH 传输
问题
git ·push 时出现问题
1 | fatal:Authentication failed for‘https://git ... |
原因/解决:
github 政策改变,在填写 password 时要使用 token
https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
优化
但是使用 https 协议每次都要输入 token
改为 ssh 传输
参考
https://blog.csdn.net/qq_41726670/article/details/124389683
查看现在使用什么协议传输
1 | git remote -v |
可以看出来使用了 https 协议
修改为 ssh 传输(前提事先生成 ssh 密钥)
1 | git remote set-url origin git@github.com:用户名/仓库 |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Center-cr's Blog!
评论


