zoukankan      html  css  js  c++  java
  • git版本管理之git-ssh 配置和使用

    1.设置用户名和邮箱
     $ git config --global user.name "gsx-gh"
     $ git config --global user.email "gsx@126.com"

    2.生成密钥

    $ ssh-keygen -t rsa -C "gsx@126.com"
    Generating public/private rsa key pair.
    Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa):
    Created directory '/c/Users/Administrator/.ssh'.
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /c/Users/Administrator/.ssh/id_rsa.
    Your public key has been saved in /c/Users/Administrator/.ssh/id_rsa.pub.
    The key fingerprint is:
    SHA256:XwstvBad8mew3XT+IRSPV9+EZEL6WNEje+dW/qzAGFo gsx@126.com
    The key's randomart image is:
    +---[RSA 2048]----+
    |           .+.o  |
    |           ..=o. |
    |          . .+..o|
    |         . *..=.*|
    |        S E B+ **|
    |         + %.=.+=|
    |        . = *.+++|
    |         .   +. =|
    |              ...|
    +----[SHA256]-----+

    3.复制/c/Users/Administrator/.ssh/id_rsa.pub中生成的内容,登陆github账号添加ssh-key

    title自定义

    将公钥添加到key中,点击ADD保存

    4.测试

      

    $ ssh -T git@github.com
    The authenticity of host 'github.com (192.30.253.112)' can't be established.
    RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
    Hi gsx! You've successfully authenticated, but GitHub does not provide shell access.

    出现以上信息,则设置成功,可以使用ssh访问提交代码。

    ps:以上命令在gitbash软件命令行执行。安装git

  • 相关阅读:
    python求pi的方法
    Python:字符串格式化
    Python time模块学习
    开源的PaaS平台
    车牌识别技术实现方式及应用场景
    ASP.NET车辆管理系统
    Spark+Hadoop+IDE环境搭建
    大数据平台技术方案及案例
    主流大数据平台及解决方案对比
    大数据平台架构——通用版
  • 原文地址:https://www.cnblogs.com/sagech/p/5719943.html
Copyright © 2011-2022 走看看