zoukankan      html  css  js  c++  java
  • git--config

    1 设置用户

     

    1.1 全局用户

     

    1.1.1 设置姓名、邮箱

    git config --global user.name "你的账号名称"
    git config --global user.email "你的邮箱"
    

    1.1.2 生成 SSH key 文件

    一路回车,使用默认值即可

    ssh-keygen -t rsa -C "你的邮箱"
    

    1.1.3 添加 key 到 github 账号上

     
    1. 到对应路径中拷贝刚生成的 xxx.pub 文件中的内容(一个字符串)
    2. 登录 github 账号,点击 头像->Settings->SSH and GPG keys-> New SSH key
    3. Title 任意,Key 中粘贴上拷贝的字符串,确认(可能需要输入密码确认)

    1.1.4 连接测试

    ssh -T git@github.com
    
    1. 成功提示

      Hi 你的账号名称! You've successfully authenticated, but GitHub does not provide shell access.

    2. 连接出错
      1. Permission denied
        1. 错误提示(类似下面这样子的)

          Permissions 0670 for 'home/12131.ssh/idrsa' are too open. It is recommended that your private key files are NOT accessible by others. This private key will be ignored. Load key "home/12131.ssh/idrsa": bad permissions Permission denied (publickey).

        2. 通过设置权限解决
          chmod 755 ~/.ssh/
          chmod 600 ~/.ssh/id_rsa ~/.ssh/id_rsa.pub
          chmod 644 ~/.ssh/known_hosts
          

    Created: 2019-12-10 周二 16:22

    Validate

  • 相关阅读:
    epoll源码实现分析[整理]
    linux几种时间函数总结
    linux几种定时函数的使用
    linux下redis数据库的简单使用
    网络编程之非阻塞connect编写
    网络编程之select
    数码相框(LCD、I2C)
    centos tftp和samba的安装与配置
    libevent库简单使用
    c语言随机数
  • 原文地址:https://www.cnblogs.com/heidekeyi/p/12017427.html
Copyright © 2011-2022 走看看