Git-03: 使用Git的最小配置

李文轩 2019-02-07
声明:这是本人学习极客时间的Git三剑客的笔记,有侵权请联系我。


添加配置:

$ git config [--local|--global|--system] user.name 'Your name'
$ git config [--local|--global|--system] user.email 'Your email'

查看配置:

$ git config --list [--local|--global|--system]

各层级区别:

  • local: 紧限当前仓库
  • global (最常出现): 当前用户的所有仓库
  • system: 本系统的所有用户
  • local config 比 global 有更高优先级;在配置 global 后,在某一仓库里配置 local 的话,系统会优先采取 local 配置

清理配置

$ git config --unset --local user.name
$ git config --unset --global user.name
$ git config --unset --system user.name
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。