Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I created a public key for ssh and registered that key with BitBucket. I then attempted to push:

$ hg push ssh://jhayward@bitbucket.org/johncharrell/[project name]
pushing to ssh://jhayward@bitbucket.org/johncharrell/[project name
running ssh jhayward@bitbucket.org "hg -R johncharrell/[project name serve --stdio"
remote: Warning: Permanently added the RSA host key for IP address '[server IP]' to the list of known hosts.
remote: Permission denied (publickey).
abort: no suitable response from remote hg!

What do I need to do so that my public key (or some other created for the purpose) will let me do an hg push from the shell or crontab? In BitBucket, I have read and write permissions to the project, but not to my knowledge anything administrative.

share|improve this question
The error Permission denied (publickey) basically means your public key is either missing from bitbucket or its somehow invalid. Try making a new .pub key with ssh-keygen and delete the old one referring to your host machine and register it. – htor Sep 14 '12 at 19:15
1  
Are you sure you are using the correct URL format? Normally, it would be: ssh://hg@bitbucket.org/accountname/reponame/ – jasonwryan Sep 14 '12 at 19:42

1 Answer

I recommend you create your repository first on bitbucket first then use the ssh parameter for hg provided by BitBucket to pull with mercurial. After that you can just do hg push without any parameters.

If you already have a repository, you have to do this in a new directory and copy your initial changes over the repository freshly checked out from BitBucket.

share|improve this answer
You can also fix the repository url in local copy's .hg/hgrc (section [paths], key default). – peterph May 9 at 9:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.