5

Windows has an environment variable HOME which is on a remote serve (say Y:/, set by administrator and suppose not to be changed) and I start Emacs on my local disk, say C:/. (Emacs becomes slow if I start from Y:/)

However .gitconfig file locates on Y:/ by default and magit cannot find it so I don't have the right settings for user name and emails, even if I move .gitconfig to C:/.

Is it possible to set magic and git settings independently or read .gitconfig from Y:/?

Magit version: Git 2.7.4.windows.1, Emacs 24.4.1, windows-nt

  • Your admin sets HOME? That's not a standard Windows variable. If you tell git to read from Y: it will also be slow, I suggest copying your $HOME/.gitconfig file to C: as well. – npostavs Jun 13 '16 at 12:03
  • @npostavs, I understand that it is not a Windows variable, but I have to remotely log into a Unix serve to work and run some software on serve. So I guess It is just easy for some common configurations on both? not sure... Tried to copy the $HOME/.gitconfig to C:/, doesn't work... but thanks anyway – NAX Jun 13 '16 at 13:15
  • Actually I think I missed something from your description, what do you mean by "start Emacs on my local disk"? Do you mean that you change HOME before starting Emacs? What does (getenv "HOME") return? – npostavs Jun 13 '16 at 15:19
  • @npostavs yes, you are right, I use batch file to start Emacs setting HOME to somewhere on my local disk (C:/ in this case per se). So it seem (getenv "HOME") will give C:/ but everything outside Emacs still use Y:/ as HOME, such as git. – NAX Jun 14 '16 at 6:38
  • Then copying .gitconfig should work. To be clear, by "copy to C:" I meant copy to the directory in C: that you set as HOME in the emacs bat file. – npostavs Jun 14 '16 at 12:28
4

Since Magit can't find my .gitconfig file even though it is in the HOME path of Emacs, git config --system can be used to change user name and email such that Magit can find them.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.