zoukankan      html  css  js  c++  java
  • Git 的基本配置

    设置签名

    系统用户级别: 登录当前操作系统的用户范围

    git config --global user.name "hglibin"
    git config --global user.email hgnulb@163.com
    

    信息保存位置:

    ~/.gitconfig文件
    

    查看命令:

    cat ~/.gitconfig
    

    检查配置信息:

    git config --list
    

    项目级别/仓库级别: 仅在当前本地库范围内有效

    git config user.name "hglibin"
    git config user.email hgnulb@163.com
    

    信息保存位置:

    ./.git/config
    

    查看命令:

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

    级别优先级

    • 就近原则: 项目级别优先于系统用户级别,二者都有时采用项目级别的签名。
    • 如果只有系统用户级别的签名,就以系统用户级别的签名为准。
    • 二者都没有不允许。

    生成SSH keys

    # 查看本地有没有
    cat ~/.ssh/id_rsa.pub
    # 若无则生成新的
    ssh-keygen -t rsa -C "hgnulb@163.com"
    # 复制id_rsa.pub里面的key
    cat ~/.ssh/id_rsa.pub
    

    配置SSH keys

    Github
    https://github.com/settings/keys

    Gitlab
    https://git.lug.ustc.edu.cn/profile/keys

    Gitlab.com
    https://gitlab.com/profile/keys

    测试是否联通

    ssh git@github.com
    ssh git@gitlab.com
    ssh git@git.lug.ustc.edu.cn
    
  • 相关阅读:
    学习Faster R-CNN代码roi_pooling(二)
    应用安全
    应用安全
    应用安全
    应用安全
    应用安全
    红队
    应用安全
    应用安全
    应用安全
  • 原文地址:https://www.cnblogs.com/hgnulb/p/11876673.html
Copyright © 2011-2022 走看看