[linux] git

配置ssh连接github: github官网教程

注意 配置成功后连接github应使用git方式,而不是https方式,例如:

1
2
3
4
# http方式
git clone https://github.com/yfzm/yfzm.github.io
# git方式
git clone git@github.com:yfzm/yfzm.github.io

如果之前已经通过https方式clone了仓库,将.git/config中的url修改为git方式即可,不需要重新clone

Troubleshooting

在使用lfs时git pull报错:

1
error: proxy connect tcp: tls: oversized record received with length 20527

解决方案

检查环境变量https_proxy是否设置正确,往往是因为被设置成了https开头的url地址,改成http开头的即可。