schacon / hg-git

mercurial to git bridge, pushed to directly from the hg-git plugin in Hg
GNU General Public License v2.0
620 stars 71 forks source link

Permission denied (publickey) #161

Closed GWBasic closed 10 years ago

GWBasic commented 13 years ago

This is most likely a documentation issue. (You might think it's a "User error," but I disagree.)

I have a mercurial repository that I'm trying to move to GitHub. Following the instructions, I created my repository on GitHub, and then tried to push with the following commands:

Andrew-Rondeaus-Laptop:objectcloud andrewrondeau$ hg bookmark -r default master Andrew-Rondeaus-Laptop:objectcloud andrewrondeau$ hg push git+ssh://gwbasic@github.com/GWBasic/ObjectCloud.git

The plugin then spun my CPU up for what seemed like an eternity while it converted my history, and then aborted. The output is at the end.

I'm assuming there's some additional configuration needed to set everything up. Perhaps I somehow have to generate or install a key, or specify some kind of a password? Could someone please explain what I need to do in order to do this?

pushing to git+ssh://gwbasic@github.com/GWBasic/ObjectCloud.git importing Hg objects into Git at: 0/904 at: 100/904 at: 200/904 at: 300/904 at: 400/904 at: 500/904 at: 600/904 at: 700/904 at: 800/904 at: 900/904 creating and sending data Permission denied (publickey). abort: the remote end hung up unexpectedly

rctay commented 13 years ago

(To see conversion progress, you could have passed -v to the push.)

Yes, there's some additional configuration needed to push to github. Take a look at this document:

http://help.github.com/troubleshooting-ssh/

Basically, you'll need to:

GWBasic commented 13 years ago

Grrr, still can't get "ssh -v" to work. This seems to be outside of Hg-git's scope at this point.

Thanks for your help; however, you REALLY need to link to these guides on http://hg-git.github.com/

Mercurial uses usernames / passwords in HTTPS mode, thus these steps are new, unknown, unexpected, and required to any Mercurial user expecting conventional usernames / passwords.

GWBasic commented 13 years ago

The other confusing aspect to point out to Mercuial users is the username@ convention.

Hg-git's case, it's always git@github.com. In contrast, Mercurial users are used to username@someserver.com.

My error was that I replaced git@ with my username. IE, everything's sending now that I changed: hg push git+ssh://gwbasic@github.com/GWBasic/ObjectCloud.git to hg push git+ssh://git@github.com/GWBasic/ObjectCloud.git

I'm sure someone else will make the same mistake that I made. ;)

zamoose commented 12 years ago

I'm seeing this precise issue, but the confusing part is that it previously worked. I was able to, up until last evening, do an

hg push gh

(where 'gh' is a defined path in my repo's .hg/hgrc). Why might this suddenly have stopped working?

zamoose commented 12 years ago

Answering my own question: it stopped working because I updated Hg to 1.9, which hg-git does not yet support.

/facepalm