是否有直接方法可以用git config
列出部分中的所有键/值对?例如,列出core
部分下的所有条目。
[我正在使用git config --get-regexp <section-name>
,但似乎有点愚蠢-为什么当我只想要一个节中的所有条目时为何使用正则表达式。
有关说明,是否有一种方法可以列出当前已检出分支的所有配置条目,而无需键入分支名称? (即git config --get-regexp branch\.<branch-name>\.
)
考虑Git 2.22 (Q2 2019) introduced git branch --show-current
,可以使用:
git config --get-regexp branch\.$(git branch --show-current)\.
但是正则表达式仍然是列出配置节的方式。
示例:
vonc@voncav MINGW64 /d/git/git (master)
$ git config --get-regexp branch\.$(git branch --show-current)\.
branch.master.remote origin
branch.master.merge refs/heads/master
branch.master.pushremote master next