When modifing option values, the default config file where the new values are written to is the one in the local repository. This can be changed with --global or --system.
--list: show all options that are set in config files and their values
git config --list
In order to also show in which config file a setting was set, combine --list with --show-origin:
git config --list --show-origin
Show origin and used value for a given option
Apparently, the following command does not show all origins where an option value is set but only the origin which set the value:
--worktree read from .git/config.worktree if the option extensions.worktreeConfig is present (and true?). If this value is not present, --worktree behaves like --local.
--file (or -f) specifies the config file being written to.
dot in config names
Config names contain at least one dot, for example credential.useHttpPath. The value before the first dot indicates a section in the config file so that credential.useHttpPath = true is stored in a config file like so: