• git学习(二):git config命令


    不同的git config操作不同的参数文件

    1 git config --global        // 配置用户目录下的.gitconfig那文件
    2 git config --system        // 配置系统级配置文件
    3 git config -e              // 编辑项目版本库的.git/config文件
    4 git config -e --global     // 编辑用户主目录下的.gitconfig文件
    5 git config -e --system     // 对系统级配置文件进行编辑

    这三个配置文件分别是:

    1. 版本库级别的配置文件,优先级最高
    2. 全局配置文件(用户主目录下),优先级次之
    3. 系统级配置文件(/etc目录下),优先级最低

    git配置文件采用的ini格式的,git config <section>.<key>命令来读取INI配置文件中某个配置的键值

    如果想要更改INI文件中某个属性的值也非常简单git config <section>.<key> <value>

    1 git config core.bare        // 读取[core]小节的bare属性
    2 git config a.b something    // 修改a.b的值
    3 git config x.y.z others     // 修改x.y.z的值

    git config命令可以操作任何其他的INI文件,以下两个命令是有区别的:

    1 git config --file test.ini a.b.c "hello, world"       // 给文件test.ini添加配置项
    2 git config  test.ini a.b.d "hello, world"             // 给.git/config文件添加配置项

    第二个命令的效果如下:

    1 [core]
    2         repositoryformatversion = 0
    3         filemode = true
    4         bare = false
    5         logallrefupdates = true
    6 [test]
    7         ini = a.b.d
  • 相关阅读:
    8、【转载】python enhanced generator - coroutine
    7、【转载】python yield generator 详解
    7、利用SAX编写程序解析Yahoo的XML格式的天气预报,获取天气预报
    6、urllib.request.Request类
    5、urllib.request.urlopen()
    重载内核的一份代码的学习
    分析
    CVE-2014-0282
    IOS逆向【5】GDB调试helloworld
    IOS逆向【4】.ipa安装
  • 原文地址:https://www.cnblogs.com/tuhooo/p/8879805.html
Copyright © 2020-2023  润新知