配置多个 git 远程帐号

~/.ssh 目录创建一个文件名为 config 的文件,如下:

  1. Host gitee.com
  2. HostName gitee.com
  3. IdentityFile ~/.ssh/gitee
  4. Host github.com
  5. HostName github.com
  6. IdentityFile ~/.ssh/github

配置好以后,可以使用 ssh -vT git@gitee.com 测试。