0%

使用Git之前需要做的最小配置

配置user信息:

1
2
3
4
5
6
git config --global user.name 'your_name'
git config --global user.email '[email protected]'

#查看是否设置成功
git config --global --list

config的三个作用域

  • 缺省等同于 local
  • 优先级:local > global
1
2
3
4
git config --local		#local只对某个仓库有效
git config --global #global对当前用户的所有仓库有效
git config --system #system对系统所有登录的用户有效

显示config的配置,加 –list

1
2
3
4
git config --list --local
git config --list --global
git config --list --system