brisberg / dotfiles

Personal dotfile repository
MIT License
0 stars 0 forks source link

Cascaded Git Configs do not override values when used #2

Open brisberg opened 2 years ago

brisberg commented 2 years ago

When a git config value is specified more than once, git has some strange behavior.

For example, given this config

user.name = "Brandon Risberg"
user.name = "brisberg"

Running git config user.name results in brisberg. Meaning that the last value takes precedence.

However, performing a git commit given this set up actually signed the commit with "Brandon Risberg". Meaning that the first value takes precedence.

I do not know why this is the case.


For now, I will specify my layed git configs in order of specificity, expecting that the first instance of a variable will be used (contrary to what git config reports).