如何使用 SSH 设置 Netbeans、Mercurial 和 BitBucket
我设置了 Mercurial(实际上是 TortoiseHg),以便 Netbeans 可以与 BitBucket 交互。我使用 HTTPS 设置它,但现在我尝试使用 SSH。我没有取得太大成功。以下是我采取的步骤:
首先,我打开 PuTTYgen 并生成 SSH2-RSA 密钥。我写了我的电子邮件 - 与我在 BB 上注册时使用的电子邮件相同,我不知道这是否重要 - 作为关键评论。无论如何,我将公钥上传到 BitBucket 并且它接受了它。
然后我创建了一个私钥并使用 pageant 添加它,如 此页面指示。之后,我从命令行发出了一个命令来验证它是否有效:
hg clone ssh://[email protected]/myaccount/myrepo
它有效 - 将整个存储库克隆到我的计算机上。但后来我转到 Netbeans 并右键单击我的项目,然后转到 Mercurial >属性...。我像这样填写了该框:
default-push: ssh://[email protected]/myaccount/myrepo
default-pull: ssh://[email protected]/myaccount/myrepo
username: My Name <[email protected]>
我尝试推/拉我的存储库,但它没有做任何事情。我正在使用 Netbeans 7.0.1。我该如何解决这个问题?
I set up Mercurial (actually TortoiseHg) to work so that Netbeans could interact with BitBucket. I set it up with HTTPS, but now I'm trying to use SSH instead. I'm not having much success. Here are the steps I took:
First, I opened PuTTYgen and generated an SSH2-RSA key. I wrote my email - the same one I used to register on BB, I don't know if that matters - as the Key comment. Anyway, I uploaded the public key to BitBucket and it accepted it.
Then I created a private key and added it with pageant, as this page instructs. After that I made a command from the command line to verify it worked:
hg clone ssh://[email protected]/myaccount/myrepo
It worked - cloned the entire repo to my computer. But then I went over to Netbeans and right-clicked on my project and went to Mercurial > Properties.... I filled out the box like this:
default-push: ssh://[email protected]/myaccount/myrepo
default-pull: ssh://[email protected]/myaccount/myrepo
username: My Name <[email protected]>
I tried to push/pull my repo, but it didn't do anything. I'm using Netbeans 7.0.1. How do I fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将您的存储库设置为 https。我已经尝试过并且有效。
You can setup your repo as https. I already tried and it works.
您需要在存储库或 Netbeans 使用的存储库的 hgrc 文件中设置 SSH 链接。
详细信息可以在这里查看,如何设置:http://wiki.netbeans.org/FaqHgSSH
You will need to setup the SSH link in the hgrc file for the repository or the one that is used by Netbeans.
Details can be seen here, how it can be setup: http://wiki.netbeans.org/FaqHgSSH