Git 使用通配符检索配置设置

G_V*_*G_V 3 git

我正在学习 git,并且试图弄清楚是否可以仅使用 git 来获取某种类型的所有配置设置。

例如:

git config --get core.symlinks
Run Code Online (Sandbox Code Playgroud)

这将查看所有配置设置并返回找到的每个设置的值。过滤特定配置--global也非常简单。现在我想知道是否可以获取特定类别设置的所有设置,例如获取以 core. 为前缀的所有设置:

git config --get core'.*' //doesn't work, the documentation does suggest a [value_regex]
Run Code Online (Sandbox Code Playgroud)

这样的事情是否可能,或者我应该习惯管道和 grep ?

$ git config --list | grep core
Run Code Online (Sandbox Code Playgroud)

phd*_*phd 5

git config --get-regexp core'\.'
Run Code Online (Sandbox Code Playgroud)