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:


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

  1. After unsetting these variable in a shell session in vterm I can use the git command again but magit is still broken.
  2. I also tried unsetting those environment vars in the script that I run to launch Doom but that didn't work.
  3. Finally, I also read in the FAQ that I should try exec-path-from-shell, which I am already using. I tried executing the exec-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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.