github 使用技巧汇总

github 使用技巧汇总——新增 SSH 密钥到 GitHub 帐户、git clone 下载加速等实用配置。

src/pages/articles/_md/Tools/Git/Notes/github-usage-tips-summary.md

Github 使用技巧

【方法1】

git clone \
  -c http.postBuffer=524288000 \
  -c http.lowSpeedLimit=1000 \
  -c http.lowSpeedTime=60 \
  https://gh-proxy.com/https://github.com/radixark/miles.git

【方法2】

git config --global url.ssh://git@github.com/.insteadOf https://github.com/

git clone 成功,若不成功,则把 git:// 改成 https://。

新增 SSH 密钥到 GitHub 帐户

  1. 生成 key,一路默认即可:
➜  .ssh ssh-keygen
  1. 复制 id_rsa.pub 文件中的内容到 GitHub:
➜  .ssh cat id_rsa.pub
GitHub SSH 密钥设置页面
GitHub SSH 密钥设置页面
  1. 测试是否配置成功:
➜  .ssh ssh -T git@github.com
Hi Dragonliu2018! You've successfully authenticated, but GitHub does not provide shell access.