git配置git config命令介绍
来源:互联网 发布:淘宝街拍照片如何调色 编辑:程序博客网 时间:2024/05/20 16:00
Git 自带一个 git config的工具来帮助设置控制 Git 外观和行为的配置变量。
git有三个级别的配置文件:
- system 级别,针对当前电脑的所有用户和所有项目生效,配置文件放在/etc/gitconfig 当用git config --system key value来配置时会修改此文件
- global级别,针对当前用户的所有项目,配置文件放在用户家目录 ~/.gitconfig 当用git config --global key value来配置时会修改此文件
- 当前项目级别 只针对当前项目起作用,配置文件放在项目根目下 /path/to/.git/config 当在项目根目录下使用 git config key value来配置时会修改此文件
级别优先级: 当前项目级别 > global > system
- git config --list 列出当前所有的配置项
- git config key 列出某个具体的配置项
命令行演示:
[root@localhost ~]# git config --system user.name jerry
[root@localhost ~]# git config --system user.email jerry@example.com
[root@localhost ~]# git config --system user.email jerry@example.com
[root@localhost etc]# git config --global user.name global
[root@localhost etc]# git config --global user.email global@example.com
[root@localhost etc]# cat ~/.gitconfig
[user]
name = global
email = global@example.com
[root@localhost etc]# git config --list
user.name=jerry
user.email=jerry@example.com
user.name=global
user.email=global@example.com
[root@localhost etc]# git config user.email
global@example.com
[root@localhost etc]# git config --global user.email global@example.com
[root@localhost etc]# cat ~/.gitconfig
[user]
name = global
email = global@example.com
[root@localhost etc]# git config --list
user.name=jerry
user.email=jerry@example.com
user.name=global
user.email=global@example.com
[root@localhost etc]# git config user.email
global@example.com
阅读全文
0 0
- git配置git config命令介绍
- Git--git config命令
- git命令之git var/config 列出git配置信息
- Git 配置文件git config介绍
- 【Git配置技巧】01. 配置文件git config介绍
- 【Git配置技巧】01. 配置文件git config介绍
- git config命令使用
- git config命令使用
- git config命令使用
- git config命令使用
- git config命令详解
- git config命令详解
- git config命令使用
- git config 命令
- Git config 缩写配置
- git config 配置
- Git config 缩写配置
- Git config配置分享
- Hi3516a (4) make OSDRV_CROSS=arm-hisiv300-linux all
- 从字符串中获取最长子串的长度
- centos安装opencv全过程
- 获取文件路径时需要注意的问题
- 信号报告(5分)
- git配置git config命令介绍
- 机油纯粹的复合机油要选哪款了?
- WebView完美封装,避免繁琐设置,伸手党福利
- MYSQL数据库(十一)- 子查询、子查询用到的关键字ANY、SAME、ALL
- 六、2、继承的几种方式
- Coderforces Helpful Maths
- 淘淘商城系列——SSO系统分析
- spring mvc中请求方式相同url相同参数不相同的两个url方法分开
- U-boot 官方源码FTP下载地址 及 主页