2019-02-01 git 支持gitlab、github

2019-02-01  本文已影响0人  watermountain

1. Ref:

    https://www.jianshu.com/p/204faf70f8bb

    https://www.cnblogs.com/bdhk/p/7423329.html

2. Keys:

    编辑 ~/.ssh/config

Host github

    HostName github.com

    AddKeysToAgent yes

    UseKeychain yes

    # PreferredAuthentications publickey

    IdentityFile ~/.ssh/github_id_rsa

Host gitlab

    AddKeysToAgent yes

    UseKeychain yes

    HostName git.xxx.com

    # PreferredAuthentications publickey

    IdentityFile ~/.ssh/gitlab_id_rsa

3. 测试连接时,使用Host指定的值或HostName 指定的值

测试github

$ ssh -T git@github

测试gitlab

$ ssh -T git@gitlab

上一篇下一篇

猜你喜欢

热点阅读