When creating a repo on a git server and wanting to push your existing local repo for the first time, how do I set the remote?
M a
seems to not like me inputting the url, or a name like "origin". It gives me Wrong type argument: stringp, nil
.
The command line answer of exactly what I'm looking for is:
git remote add origin [email protected]:user/repo.git
How do I do this in magit?
The magit manual seems outdated here because I can't find the M u
option.
This might be related: Magit error on magit-remote-add.
M-a
(Meta+a
) butM a
(uppercaseM
followed by lowercasea
). DoM-x toggle-debug-on-error RET
before doingM a
again, so that we get more information about why that error occurs.M u
is only available ifmagit-remote-direct-configure
is non-nil and a remote already exists (or more precisely ifmagit-get-current-remote
returns a remote).C-h i g (magit)
and it will be the manual for the version you are using, whereas an online manual might be for a different version.M a
though. That being said, that must be the reason, I don't actualy have a remote set yet. So that would mean I have to use the command line to setup a repo for the first time? Will make that part clearer in OP too.M a
should work when there are no existing remotes. You linked to a similar issue which was fixed upstream... are you using a version of Magit that is more recent than that? If not, then update Magit. If so, useM-x toggle-debug-on-error
and add the stack trace from the error to your question.