Search code examples
gitemacsdaemonmagit

emacs daemon and magit


I've been trying out emacs as a server, and have run into a problem with magit. We have a Gitlab server at work, and when I try to use magit for a push or a pull, I'm challenged for a password. This doesn't happen when I use git from the command line, and, more importantly, it doesn't happen if I run emacs "directly" (as opposed to running emacsclient with the daemon). I should mention that I'm running on Ubuntu 15.04, and I'm using emacs 25.

I'm wondering if other people have run into this behavior? Or can point me to a remedy? Thanks for your attention!


Solution

  • The suggestions in the existing answers led me to finding a solution. I'm hoping that it will be helpful to others who run into this problem. I'm using systemd to launch the emacs daemon, and it turned out that I needed an additional directive in the emacsd.service file:

    [Service]
    ...
    Environment=SSH_AUTH_SOCK=%t/keyring/ssh
    ...
    

    So, thanks for the leads - they put me on the right track to find the answer.