诸神缄默不语-个人CSDN博文目录
使用场景:由于不可知的网络问题,无法用HTTPS克隆GitHub项目。
报错fatal: unable to access 'https://github.com/PolarisRisingWar/llm-throught-ages.git/': GnuTLS recv error (-110): The TLS connection was non-properly terminated.
解决方案:改用SSH克隆
步骤一:
在本地创建public key
参考资料:https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent?platform=linux
Linux系统,运行命令:ssh-keygen -t ed25519 -C "your_email@example.com"
在储存public key的位置(默认是.ssh/id_ed25519.pub
)得到public key
步骤二:
在GitHub设置中新增SSH Key:https://github.com/settings/keys
随便起个名字,然后将public key输入即可
步骤三:
用SSH克隆GitHub项目
复制GitHub项目的SSH URL:
在本地运行git clone ssh_url
即可