1. 生成密钥

    1
    2
    3
    4
    git config --global user.name "XXXXX"
    git config --global user.email "XXXXX@yeah.net"
    ssh-keygen -t rsa -C "XXXXX@yeah.net"

  2. 复制ras.pub内容
    上面生成的id_rsa.pub默认在c:/user/xxx/.ssh/中,打开并复制

  3. 添加密钥
    github-> setting -> SSH and GPG keys -> SSH Keys -> 粘贴id_rs.pub

  4. 测试
    ssh -T git@github.com

  5. 拉取仓库
    git clone git@github.com:XXXXX/demo.git