创建如下文件
~/.ssh/config
内容
Host github.com
HostName github.com
User git
PreferredAuthentications publickey
IdentityFile ~/.ssh/privateKeyFile
Host git.coding.net
HostName git.coding.net
User git
PreferredAuthentications publickey
IdentityFile ~/.ssh/privateKeyFile
Host git.oschina.net
HostName git.oschina.net
User git
PreferredAuthentications publickey
IdentityFile ~/.ssh/privateKeyFile
~/.ssh/privateKeyFile 对应私钥在本地的位置。
请结合隔壁教程来看 https://www.jianshu.com/p/9317a927e844
~ 表示用户主目录,linux/mac表示 /Users/你的名字名字/, windows下表示 C:\Users\你的名字\