I have two github accounts – one personal and one for my job. In most of my repos, I use my work account and magit works fine. In a couple personal repos, I have this in .git/config:

sshCommand = ssh -i /my/home/directory/.ssh/personal/id_rsa -F /dev/null

This works well from the command line for things like git push, but when I try to push from magit, I get this error:

ERROR: Permission to <personalaccount>/unified_docs_switcher.git denied to <workaccount>.

Since my work account is mentioned in the error message, it seems like magit's connection to git is ignoring the line in .git/config.

Is there some other config I can add to magit to recognize this?

Is there a different/better solution in magit to using different github accounts?

(Edit: emacs 27.1 on MacOS from here, tested on magit 2.90.1 from melpa-stable and then 20210105.1030 from melpa)

Your Answer

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

Browse other questions tagged or ask your own question.