Reputation: 1467
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!
Upvotes: 0
Views: 264
Reputation: 1467
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.
Upvotes: 2
Reputation: 8577
You're not the first to have issues with this to say the least. Which is why it is mentioned in the FAQ, which takes you to Pushing with Magit from Windows.
That summarizes the various options and contains troubleshooting instructions. But still not everyone was able to figure it out (or provide accurate enough information for us to diagnose from a distance), so a core contributor wrote a package which makes this work even on insufficiently configured systems. That package is also mentioned on that page.
Upvotes: 1
Reputation: 1324278
It depends on the protocol used for the upstream repo url.
Typically, a password is asked when ssh doesn't find the proper private/public key in $HOME/.ssh
.
And $HOME
can differ when a service is launched as a daemon, as opposed to launched by a user.
So if the upstream GitLab repo is accessed by an ssh url, that would explain the difference between the two attempts.
Upvotes: 1