zoukankan      html  css  js  c++  java
  • git 安装及配置

    1.https://github.com/ 注册,略...

    2.创建一个新的工程

    3.下载git客户端,选择git安装目录,略...

    下载地址:https://git-for-windows.github.io/

    4.生成秘钥

    ssh-keygen -t rsa -C "your@email.com"

    成功如下:

     

    5.进入到安装目录下,查看生成的秘钥

     

    6.登录github.com配置秘钥

    链接github确认添加的ssh公共密钥是否有效
    ssh git@github.com

    The authenticity of host 'github.com (192.30.255.113)' 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.255.113' (RSA) to the list of known hosts.
    PTY allocation request failed on channel 0
    Hi xxxuser! You've successfully authenticated, but GitHub does not provide shell access.
    Connection to github.com closed.

    Administrator@USER-20160524DB MINGW64 ~/Desktop

    出现上面所示:

    Warning: Permanently added the RSA host key for IP address '192.30.255.113' to the list of known hosts.

    解决:在hosts文件夹下添加如下:

    192.30.255.113  github.com

    The authenticity of host 'github.com (13.229.188.59)' can't be established.
    RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
    Are you sure you want to continue connecting (yes/no)?

    解决:查看ssy是否存在:$ ls -al ~/.ssh

    重新生成和配置sshkey第4步和第五步

    正常显示如下:

    $ ssh git@github.com
    //正常情况下,回显如下
    PTY allocation request failed on channel 0
    Hi plinx! You've successfully authenticated, but GitHub does not provide shell access.
    Connection to github.com closed.

    7.配置github远程仓库

    如果是第一次配置github远程仓库,需要设置用户名和邮箱,并添加远程地址,给远程仓库起个别名

    git config --global user.name "github用户名"
    git config --global user.email "your_github_email@qq.com"
    git remote add origin( origin:别名) git@github.com:yourName/yourRepo.git

     

  • 相关阅读:
    计算机世界中解决问题的三种技术手段
    应用程序池的经典模式与集成模式的区别
    sh文件的编译
    flex学习开始了
    com,ActiveX,Ole之间的关系学习总结
    "正在等待localhost。。”问题的解决
    一些感悟
    面向对象软件工程方法学实践【转】
    外连接在sqlserver和access之间的差异
    外连接在sqlserver和access之间的差异
  • 原文地址:https://www.cnblogs.com/lichihua/p/9174505.html
Copyright © 2011-2022 走看看