Overleaf allows git for some users. I have been using emacs and magit with overleaf since some time by providing username-password at each git push or git pull.
What I want
Now I want to configure magit to use username and password from my .authinfo
file so that it does not ask me credentials at each push or pull.
What I have
- Overleaf does not allow ssh public key based authentication right now.
- Using GNU Emacs 27.1 with Magit 20201218.1819.
- authinfo entry
machine git.overleaf.com port 443 login [email protected] password eX@mp1e
I have also tried machine https://git.overleaf.com login [email protected] password eX@mp1e
- magit config
(use-package magit
:init
(setq auth-source-debug 'trivia)
:config
(add-hook 'magit-process-find-password-functions 'magit-process-password-auth-source))
What I get
When I try to do a git push, it asks for my username. After I type in my email address (which is my username), it returns this message:
auth-source-search: found 1 results (max 1) matching (:max 1 :host "git.overleaf.com" :user "[email protected]")
And the committed changes get pushed successfully. So I guess this is a minor success since magit is able to lookup the password from the authinfo file when I provide the username.
https://[email protected]/
if your username contains a@
usually replacing it with%40
does the trick from the command line, I never tried with authinfo file. Also there is the git credential system as last resort.@
related to overleaf. I hope to try your suggestion tomorrow.