Git最小配置
添加配置
git config [--local | --global | --system] user.name 'Your name'
git config [--local | --global | --system] user.email 'Your email'
- local:作用区域为本仓库,配置文件在.git/config
- global: 作用为当前用户的所有仓库,配置文件在个人home目录下的.gitconfig里面
- system: 本系统的所有用户(这个基本不用),配置文件应该在git安装目录下
优先级:local > global > system
查看配置
git config #出现这个命令下可以添加的参数
git config --list #出现local、global、system三个范围的配置
git config [--local | --global | --system] --list #指定范围内的配置信息 这个指令添加local参数时候需要进入某个仓库里面才能使用,不然会提示错误
清除配置
git config --unset [--local | --global | --system] user.name 'Your name'
摘选自 个人的Git完整笔记