I just configured my IRC user name for ERC with (setq erc-nick "name").
Is there a similar variable for Magit, so it knows my Github username. If not, is there some ELisp I could write to add a hook to Magit or something like that?
I just configured my IRC user name for ERC with (setq erc-nick "name").
Is there a similar variable for Magit, so it knows my Github username. If not, is there some ELisp I could write to add a hook to Magit or something like that?
Here is how to set your configuration using the command-line:
/usr/local/git/bin/git config --global github.token 123456789
/usr/local/git/bin/git config --global github.user tiago
/usr/local/git/bin/git config --global user.name tiago
/usr/local/git/bin/git config --global user.email tiago@stackoverflow.com
;; for OSX
/usr/local/git/bin/git config --global credential.helper osxkeychain
/usr/local/git/bin/git config --global core.excludesfile ~/.gitignore_global
Looking for username in magit.el, I found the following function:
(defun magit-process-username-prompt (proc string)
"Forward username prompts to the user."
(let ((prompt (magit-process-match-prompt
magit-process-username-prompt-regexps string)))
(when prompt
(process-send-string proc
(concat (read-string prompt nil nil
(user-login-name))
"\n")))))
If you set up the variable user-login-name to your github nickname, you will at least have it as a default choice (just press enter).
You can also redefine the magit-process-username-prompt, replacing the (read-string...) - with your username. Beware that in this case, if you ever have to login with another username, you'll have to re-activate the original version.
The best advice was indeed given by @abo-abo : ssh keys make everything easier.