git config [<file-option>] [type] [--show-origin] [-z|--null] name [value [value_regex]]
git config [<file-option>] [type] --add name value
git config [<file-option>] [type] --replace-all name value [value_regex]
git config [<file-option>] [type] [--show-origin] [-z|--null] --get name [value_regex]
git config [<file-option>] [type] [--show-origin] [-z|--null] --get-all name [value_regex]
git config [<file-option>] [type] [--show-origin] [-z|--null] [--name-only] --get-regexp name_regex [value_regex]
git config [<file-option>] [type] [-z|--null] --get-urlmatch name URL
git config [<file-option>] --unset name [value_regex]
git config [<file-option>] --unset-all name [value_regex]
git config [<file-option>] --rename-section old_name new_name
git config [<file-option>] --remove-section name
git config [<file-option>] [--show-origin] [-z|--null] [--name-only] -l | --list
git config [<file-option>] --get-color name [default]
git config [<file-option>] --get-colorbool name [stdout-is-tty]
git config [<file-option>] -e | --edit
1.配置用户信息
1.1配置以后所有提交的用户信息
$ git config --global user.name "name"
$ git config --global user.email "email"
1.2配置本次提交的用户信息
$ git config user.name "name"
$ git config user.email "email"
2.配置文本编辑器
$ git config --global core.editor vim
3.配置比较工具
$ git config --global merge.tool vimdiff
4.查看配置文件
4.1查询所有参量
$ git config --list
4.2查询某个参量
$ git config user.name
5.其他说明
上面的命令其实修改的都是git的config文件,他们分别存放在.git/config|~/.gitconfig|/etc/gitconfig优先级也是从大到小