最近工作中使用到了Git,虽然以前学习过,但是已经忘的差不多了,遂将本次配置过程整理成笔记以备忘
文件的内容如下 ```shell
StrictHostKeyChecking no # 为了更简化,把known_hosts也省略掉了 UserKnownHostsFile /dev/null # coding Host git.coding.net
User gana10007@163.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/coding.net
# github
Host github.com
User gana10007@163.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/github
```IdentityFile指向你不同托管平台存放公钥的文件名具体配置如下图测试是否能够连接:shell ssh -T git@github.com注意:@后面跟的内容以平台项目的地址为准,例如码市的: ssh -T git@git.conding.net
转载于:https://www.cnblogs.com/coder163/p/8592058.html
