Today I Learned

A Hashrocket project

Give git config more context with `--show-scope`

git config is only as helpful as the options you pass.

In the simplest instance I only get a value:

> git config

If I pass the --get-regexp flag I get the key and the value for all the instances of that key:

> git config --get-regexp

If I pass the --show-scope flag (added in 2.26) I get the scope:

> git config --show-scope --get-regexp

If I pass the --show-origin then I also get the file where the key was configured:

> git config --show-scope --show-origin --get-regexp
global file:/home/dev/.gitconfig
local  file:.git/config

The git blog is an incredible way to learn about the new functionality in each git release.