跳至主要內容

git的配置文件

RebeccaYangitgithubgitgithub约 254 字

Git学习之查看config配置

关注

git的配置指令是 git config。用于配置git的用户,邮箱,域名等信息。详细信息可参考git-scm.comopen in new windowgit-configopen in new window

config配置有3个层级:

  • system(系统级别)
  • global(用户级别)
  • local(仓库级别)

覆盖优先级为local 》 global 》 system。优先读取local,其次是global,最后是system。

查看配置

读取system级别的配置:

$ git config --system --list

读取global级别的配置:

$ git config --global --list

读取local级别的配置:

$ git config --local --list

修改配置

如果想修改配置的话,加上不同的参数就可以在不同的级别上配置了。

比如配置global级别的信息:

$ git config --global user.name "yourusername"
$ git config --global user.email "youremail@email.com"

删除配置

$ git config --unset user.name

版权声明

本文转载于简书博主RebeccaYanopen in new window的文章。
原文链接:https://www.jianshu.com/p/1ae2ff6c90deopen in new window

上次编辑于:
贡献者: 00D2