zoukankan      html  css  js  c++  java
  • windows同一台电脑设置多个公钥与不同github帐号交互

    1 生成公钥

    1. 安装git,从C:Documents and SettingsAdministrator.ssh目录打开 "Git Bash";
    2. 键入命令:ssh-keygen -t rsa -C "email@email.com","email@email.com"是github账号;
    3. 提醒你输入key的名称,输入如id_rsa_githubName;
    4. 在C:Documents and SettingsAdministrator下产生两个文件:id_rsa_githubName和id_rsa_githubName.pub;

    2 添加公钥到某个github账号

    用记事本打开id_rsa.pub文件,复制内容,在github.com的网站上到ssh密钥管理页面,添加新公钥,随便取个名字,内容粘贴刚才复制的内容;

    3 在C:Documents and SettingsAdministrator.ssh目录配置文件config

    #personal account
    Host github.com
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_rsa

    #work account
    Host github.com-work
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_rsa_githubName

    4 用ssh访问github

    git clone git@github.com-work:socialchorus/repo_name.git

  • 相关阅读:
    调接口
    500 Internal Server Error
    htaccess跨域
    Header add Access-Control-Allow-Origin: *
    如何写jquery插件
    笔记
    互联网思维,谁的思维?
    超强js博客值得学习!!!
    学好js的步骤
    NOIP2000 进制转换
  • 原文地址:https://www.cnblogs.com/deliver/p/5311953.html
Copyright © 2011-2022 走看看