git第一篇:git config

git config 有3种级别,local、global、system,优先级依次降低。

local表示仓库级别,对应的配置文件是仓库根目录的。global表示(操作系统)用户级别,对应的配置文件是当前用户根目录的。system表示git进程级别,对应的配置文件是。

查看所有配置:

git config -l

查看仓库级别的配置:

git config --local -l

查看用户级别的配置:

git config --global -l

查看进程级别的配置:

git config --system -l

查看某个变量最终的配置:

git config --get xxx

如果想对某个仓库做特殊设置,只需在该仓库根目录中执行git config --local xxx yyy即可,如设置user.name,git config --local user.name zhangsan。

user.name,user.email是预定义的配置,如果想增加自定义配置,则需要用--add,如git config --local --add country.name china。如果想去掉某项配置,则需要用--unset,如git config --local --unset country.name。

 

posted on 2015-07-16 18:48  koushr  阅读(305)  评论(0)    收藏  举报

导航