I use a highly customised process for regenerating my ~/.gitconfig.
https://github.com/Skenvy/dotfiles/blob/home/git/config/README.md --
Every bashrc run re-runs a "git config apply" script. https://github.com/Skenvy/dotfiles/blob/home/git/config/apply.sh --
Despite my intended target config not really changing, wsl will usually
leave my file untouched -- this script on 95% of startups will report no
changes found. But every so often, if wsl is not started for a few days,
it reports a change, which is typically some [user] lines missing.