博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Git config 配置文件详解
阅读量:4040 次
发布时间:2019-05-24

本文共 714 字,大约阅读时间需要 2 分钟。

一、配置文件级别

Git 使用简单的 .ini 文件作为配置文件,配置文件中记录了很多 Git 命令使用的各种选项和设置,Git 支持不同级别的配置文件,下面按照优先级从高到低的顺序对它们进行介绍:

.git/config           当前版本库特定的配置文件,可使用 --file选项修改,是Git的默认选项,此文件中的设置具有最高优先级。

~/.gitconfig         当前用户的配置文件,可使用 --global选项修改。

/etc/gitconfig      系统级别的配置文件,可使用 --system 选项修改,此文件中的设置优先级最低。

二、配置选项

git  config  --file  user.name  "sean"

git  config  --file  user.email  "sean@example.com"

git  config  --global  user.name  "sean"

git  config  --global  user.email  "sean@example.com"

git  config  --system  user.name  "sean"

git  config  --system  user.email  "sean@example.com"

三、移除配置

使用 git config -l 命令可列出在配置文件中配置的所有项。

git config --unset 可移除配置文件中的配置,使用方法如下:

       git  config  --unset  user.name

       git  config  --unset  --global  user.name

       git  config  --unset  --system  user.name

转载地址:http://ikadi.baihongyu.com/

你可能感兴趣的文章
gdb调试命令的三种调试方式和简单命令介绍
查看>>
C++程序员的几种境界
查看>>
VC++ MFC SQL ADO数据库访问技术使用的基本步骤及方法
查看>>
VUE-Vue.js之$refs,父组件访问、修改子组件中 的数据
查看>>
Vue-子组件改变父级组件的信息
查看>>
Python自动化之pytest常用插件
查看>>
Python自动化之pytest框架使用详解
查看>>
【正则表达式】以个人的理解帮助大家认识正则表达式
查看>>
性能调优之iostat命令详解
查看>>
性能调优之iftop命令详解
查看>>
非关系型数据库(nosql)介绍
查看>>
移动端自动化测试-Windows-Android-Appium环境搭建
查看>>
Xpath使用方法
查看>>
移动端自动化测试-Mac-IOS-Appium环境搭建
查看>>
Selenium之前世今生
查看>>
Selenium-WebDriverApi接口详解
查看>>
Selenium-ActionChains Api接口详解
查看>>
Selenium-Switch与SelectApi接口详解
查看>>
Selenium-Css Selector使用方法
查看>>
Linux常用统计命令之wc
查看>>