Overview
This is a new issue for me that started about a week ago.
I started having issues with some git commands in when using magit and vterm recently. Specifically, git couldn't read my global config file. However, if I ran git from a non-Emacs terminal everything worked properly.
I did a little research and learned that Emacs sets the following two environment vars:
GIT_CONFIG_GLOBAL=/dev/null
GIT_CONFIG_NOSYSTEM=1
These settings make git ignore my global config. Hooray for a problem half solved! Now I need to figure out how to un-set these variables in an Magit-friendly way.
What I've Tried
- After unsetting these variable in a shell session in vterm I can use the git command again but magit is still broken.
- I also tried unsetting those environment vars in the script that I run to launch Doom but that didn't work.
- Finally, I also read in the FAQ that I should try
exec-path-from-shell
, which I am already using. I tried executing theexec-path-from-shell-initialize
function interactively but that did not seem to help.
Does anyone know how to configure magit to unset these variables?
System Information
- WSL 2
- Ubuntu 20.04
- Latest version of Doom (as of 4/4/22)
- Emacs 28.1