zoukankan      html  css  js  c++  java
  • Github 多账号配置

    1. 不同账户,生成不同密钥
    ssh-keygen -t rsa -f github1 -C "xxx@163.com"
    ssh-keygen -t rsa -f github2 -C "xxx@163.com"

    2. 把生成的公钥添加到github上,设置,ssh-key,new ssh。

    3. 编辑~/.ssh/config文件添加如下内容:
      # 其中Host是主机别名,HostName是github服务器地址,User是GitHub服务器用户名,
      # IdentityFile是和GitHub服务器通信的ssh私钥,通过IdentityFile就可以区分出
      # 不同的账号。
      Host account1
      HostName github.com
      User git
      IdentityFile ~/.ssh/github1
      Host account2
      HostName github.com  
      User git
      IdentityFile ~/.ssh/github2
    4. ssh-add 管理
      ssh-add github1
      ssh-add github2

    5. git remote set-url origin account1:github账号/xxxx.git

  • 相关阅读:
    CAN
    snip_opencv环境配置和测试程序
    snip_进制转换代码段
    代码高亮的调试过程
    test3
    test2
    dsBlog_杂类
    js秒数转换为时分秒
    Linux 添加硬盘挂着到指定目录
    上海居住证积分续办
  • 原文地址:https://www.cnblogs.com/hanwen1014/p/10386209.html
Copyright © 2011-2022 走看看