1.git配置
1.1配置文件位置:
级别 | linux位置 | win位置 |
---|---|---|
系统级 | /etc/gitconfig | git安装目录/etc/gitconfig |
项目级 | 项目目录/.git/config | 同左 |
用户级 | ~/.gitconfig | c:/users/“当前用户”/.gitconfig |
1.2配置文件可选项
- [color]
ui = auto - [credential]
helper = cache --timeout=86400 (输入一次凭据后缓存24小时)
1.3别名
- 临时
方法:命令行输入alias xx=‘xxxxx’
特点:只在当前bash窗口生效,关闭Bash窗口则消失。 - 永久
方法:编辑 /etc/profile,添加alias xx=‘xxxxx’
。保存修改后重启bash或source /etc/profile
特点:系统级修改,永远有效。