Trying to push to personal Git repo fails

Asked by Adolfo Jayme Barrientos

I’ve followed the directions in [1], but when I try to add the personal remote for pushing (“git remote add origin lp:~fitojb/a11y-profile-manager”) it fails with the response “fatal: remote origin already exists”, which is obviously not true [2].

Perhaps I cloned lp:a11y-profile-manager wrongly? Since the default Launchpad command didn’t work (executing “git clone git+ssh://git.launchpad.net/a11y-profile-manager” as indicated in [3] failed with “Launchpad user 'fito' doesn't have a registered SSH key”—how come Launchpad thinks that is my username? I haven’t told it so, given there’s no “bzr launchpad-login” equivalent for Git!), I edited my .gitconfig as per [1] and cloned with the command “git clone lp:a11y-profile-manager”, which succeeded this time, but now I’m stuck in the “adding remote” step.

What do I do next?

[1]: https://help.launchpad.net/Code/Git
[2]: https://code.launchpad.net/~fitojb/+git
[3]: https://code.launchpad.net/~themuso/a11y-profile-manager/+git/a11y-profile-manager

Question information

Language:
English Edit question
Status:
Answered
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Colin Watson (cjwatson) said :
#1

This is the git command-line UI being confusing. When it says "remote origin already exists", it doesn't mean that the URL you've supplied already exists remotely; what it actually means is "in this local repository, I already have a configured remote named 'origin'".

"git clone" will have created a remote named "origin" already, since that's its default, hence the clash. I would recommend instead saying something like:

  git remote add fitojb lp:~fitojb/a11y-profile-manager

... or whatever you like instead of "fitojb" there, just not "origin". You can see the existing remotes using "git remote show", or more detail on an existing remote using "git remote show origin" etc.

Regarding your username troubles, the usual way to deal with this is just to set your Launchpad username in ~/.ssh/config, like this:

  Host git.launchpad.net
          User fitojb

Can you help with this problem?

Provide an answer of your own, or ask Adolfo Jayme Barrientos for more information if necessary.

To post a message you must log in.