Linux Mint Emacs 25.1

Remote repo URL

origin (h t t p://git.remotehostname.git)

In application SmartGit when I pull/push data from remote repo, it's prompt credentials ONLY ONCE.

But when I try pull data by Magit - it's prompt credentials EVERY TIME when I use magit-pull or magit-push.

How I can save credentials in Magit?


1 Answer 1


How I can save credentials in Magit?

The best way to do that is to not do it and instead configure git itself. That way it works on the command-line and in Magit.

There are two problems with that approach:

  • You have to learn how to configure this aspect of git and there are many different options available. On the other hand because many more people use git than Magit, it should be easier to search for relevant documentation and tutorials.

  • Depending on how you configure git, these configurations may not carry over to Magit. Typically this happens when a user configures git in their shell startup file, but then start Emacs by clicking on a symbol. In that case emacs isn't a child process of, say, bash and so it does not inherit its environment variables.

Magit actually can remember your password for you and I just improved that functionality a few minutes ago (so make sure to update before trying this out). See the doc-string of magit-process-password-auth-source, it should have you covered.

  • How about if I am using notabug?... The help documentation for magit-process-password-auth-source only mentions github... May 21, 2022 at 14:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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