亚洲区国产区激情区无码区,国产成人mv视频在线观看,国产A毛片AAAAAA,亚洲精品国产首次亮相在线

git config 命令

Git 基本操作Git 基本操作

git config 命令用于查看或者設(shè)置 git 倉庫的配置信息。

 

1. git config 命令的語法

git config [<file-option>] [--type=<type>] [--show-origin] [-z|--null] name [value [value_regex]]

git config 命令的選項(xiàng)比較多,我們著重介紹常用的配置命令。

 

2. 查看 git 配置信息

1)查看 git 全部配置信息:

# 查看全部配置信息
git config --list --global

# 或者
git config -l --global

2)查看 git 某項(xiàng)的配置信息

# 查看 user.name 配置信息
git config --global user.name

# 查看 user.email 配置信息
git config --global user.email

參數(shù)說明:

其中 --global 是作用域參數(shù)。還有 --local 和 --system。

--local 只對(duì)單個(gè)倉庫有效。--system 對(duì)系統(tǒng)所有登錄用戶所有的倉庫有效【很少用到】。--global 對(duì)當(dāng)前用戶所有的倉庫有效【經(jīng)常用到】。

如果不加作用域參數(shù),默認(rèn)是 --local。

如果 global 和 local 都配置了,那么當(dāng)前倉庫用的是 local 配置。

 

3. 初始化或者設(shè)置配置參數(shù)

設(shè)置配置項(xiàng)的語法格式:

    git config [--local|--global|--system] --unset section.key

范例:設(shè)置用戶名稱和用戶郵箱。

git config --global user.name 'your username'
git config --global user.email 'your email address'

 

4. 刪除配置項(xiàng)

刪除配置項(xiàng)的語法格式:

git config [--local|--global|--system] --unset section.key

范例:刪除用戶郵箱。

git config --global --unset user.email 'your email address'

Git 基本操作Git 基本操作