zoukankan      html  css  js  c++  java
  • windows git 配置

    安装

    下载地址:https://git-scm.com/downloads

    image-20200213102140692

    image-20200213102203600

    具体可以参考:https://blog.csdn.net/qq_32786873/article/details/80570783
    一句话总结:双击->自定义目录->一直next到底

    配置github

    配置用户名、邮箱

    //此处name可修改也不是用于登录github的登录名
    git config --global user.name "username"
    //github邮箱
    git config --global user.email "email"
    

    查看用户名邮箱

    git config --global user.name
    git config --global user.email
    

    生成公钥

    ssh-keygen -t rsa -C "yourEmail@xx.com"
    

    按三次回车
    image-20200213102811969

    看到保存的路径

    cd ~/.ssh
    # 公钥的内容在id_rsa.pub
    cat .id_rsa.pub
    

    复制id_rsa.pub中的内容,在github设置中新建ssh key,title能够为空

    image-20200213103038956

    测试ssh

    ssh -T git@github.com
    

    image-20200213104021665

    如上图,报错如下

    ssh: connect to host github.com port 22: Connection timed out
    

    可能存在的原因 github的公钥配置错误了,可是我反复尝试了多次,还是有问题,原因可能是端口被占用,终于找到了解决方案:

    在~/.ssh 下,即公钥的统计目录中新建config文件,内容如下

    Host github.com
    
    User git
    
    Hostname ssh.github.com
    
    PreferredAuthentications publickey
    
    IdentityFile ~/.ssh/id_rsa
    
    Port 443
    

    image-20200213104335452

    再次ssh -T git@github.com,终于成功了

    image-20200213104437463

  • 相关阅读:
    QPS的优化
    面试题
    py-redis
    集群化的部署
    RESTful设计
    python第三方库------jieba库(中文分词)
    csv文件读写处理
    python中的turtle库(图形绘画库)
    html中form表单的使用方法和介绍
    WC2019
  • 原文地址:https://www.cnblogs.com/LeesinDong/p/12308598.html
Copyright © 2011-2022 走看看