Git学习笔记02git config

摘自《Git权威指南》

1、执行下面的命令,将打开./demo/.git/config文件进行编辑

$ cd demo

$ git config -e

2、执行下面命令,将打开用户目录下的.gitconfig文件进行编辑

$ git config -e --global

3、执行下面命令,将打开git安装目录下的gitconfig文件进行编辑

$ git config -e --system

4、git config 命令可以用于读取和更改INI文件的内容。

读取[core]小节的bare的属性值

1$ git config core.bare

false

2)如果想更改或者设置INI文件中某个属性的值

$ git config a.b something

$ git config x.y.z others

打开.git/config文件,会看到如下内容:

[a]

b = something

[x “y”]

z = others

3)git config命令也可以操作任意INI文件

$ GIT_CONFIG=test.ini git config a.b.c.d “Hello, world”

$ GIT_CONFIG=test.ini git config a.b.c.d

Hello, world

原文地址:https://www.cnblogs.com/craftor/p/2754138.html