You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Config file location
--global use global config file
--system use system config file
--local use repository config file
--worktree use per-worktree config file
-f, --file <file> use given config file
--blob <blob-id>read config from given blob object
Action
--get get value: name [value-regex]
--get-all get all values: key [value-regex]
--get-regexp get values for regexp: name-regex [value-regex]
--get-urlmatch get value specific for the URL: section[.var] URL
--replace-all replace all matching variables: name value [value_regex]
--add add a new variable: name value
--unset remove a variable: name [value-regex]
--unset-all remove all matches: name [value-regex]
--rename-section rename section: old-name new-name
--remove-section remove a section: name
-l, --list list all
-e, --edit open an editor
--get-color find the color configured: slot [default]
--get-colorbool find the color setting: slot [stdout-is-tty]
Type
-t, --type <> value is given this type
--bool value is "true" or "false"
--int value is decimal number
--bool-or-int value is --bool or --int
--bool-or-str value is --bool or string
--path value is a path (file or directory name)
--expiry-date value is an expiry date
Other
-z, --null terminate values with NUL byte
--name-only show variable names only
--includes respect include directives on lookup
--show-origin show origin of config (file, standard input, blob, command line)
--show-scope show scope of config (worktree, local, global, system, command)
--default <value> with --get, use default value when missing entry
.gitconfig 的基本配置
前言
通常情况下当们在初次使用 Git 的时候,需要设置一些
个人信息
&git alias
等,从而提高一些 git 方面的效率。个人信息
这样我们在
commit
的时候能把个人信息附带上git alias
别名配置以后可以用简短的命令代替默认命令,而且还可以自定义一些个性
git <命令>
寻找 .gitconfig 文件
Mac:
vim ~/.gitconfig
Windows:
配置 .gitconfig 文件
下面的 alias 是我个人习惯,可以根据自己的习惯进行修改
git lg 效果如下:
查看设置邮箱
友情提示
git 默认
不区分
文件名大小写
变化!!如何使用使用
git config
的文档提示形式 1
通过
git config
+Config file location
+Action
的组合形式形式 2
通过
git config
+Action
形式 n
....
参考文献
git-config
pretty-formats
pretty-options
The text was updated successfully, but these errors were encountered: