美文网首页
Git-03-配置GitHub仓库

Git-03-配置GitHub仓库

作者: GJCode | 来源:发表于2018-12-02 22:09 被阅读4次

配置GitHub

1、配置同一个GitHub网站下多个仓库
  • .ssh文件夹中配置config文件(如果没有可以手动创建)
  • config文件中设置每个仓库的Host
Host github.com-GJ9117
    User git
    HostName github.com
    IdentityFile ~/.ssh/id_rsa_gj9117@gmail.com

Host后面配置的标识作用于在git remote add 时填写的git地址的前半部分所要更换的内容

git remote add GJ9117 git@GJ9117:GJBlog/LearnGit.git
2、配置不同网站仓库
  • 仅仅在.ssh文件夹下config的文件中添加多个如下即可。
Host github.com-GJ9117(标识)
    User git
    HostName github.com
    IdentityFile ~/.ssh/id_rsa_gj9117@gmail.com(对应sshKey的公钥)

参考资料

相关文章

网友评论

      本文标题:Git-03-配置GitHub仓库

      本文链接:https://www.haomeiwen.com/subject/jziscqtx.html