配置文件种类
- /etc/gitconfig:包含了适用于系统所有用户和所有项目的值 --system【查看 --system 配置项】
git config --system -l
- ~/.gitconfig:只适用于当前登录用户的配置 --global【查看 --global 配置项】
git config --global -l
- 位于git项目目录中的.git/config:适用于特定git项目的配置–local【查看 --local 配置项】
git config --local -l
配置 --global
- 常用命令简写配置
git config --global alias.st status
git config --global alias.pl pull
git config --global alias.ps push
git config --global alias.ci commit
git config --global alias.lg log
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.mg merge
-
直接修改配置文件
2.1 查找配置文件位置git config --global -e
2.2 打开配置文件修改
[alias] co = checkout ci = commit st = status pl = pull ps = push df = diff lg = log cp = cherry-pick ca = commit -a br = branch mg = merge