配置 SSH 登录
- 安装 OpenSSH,已安装忽略
apt install openssh - 生成 SSH 密钥
1 | # cd ~/.ssh |
- cat 下密钥内容,复制
cat id_rsa.pub - 前往 https://github.com/settings/ssh/new 添加刚刚复制下来的密钥
- 最后使用
ssh –T git@github.com测试是否成功
解决每次都要输入账号密码
执行 git config --global credential.helper store 后,下次操作再输入一遍账号密码之后就不用再输入了
强制拉取
1 | $ git fetch --all |