如何使用 SSH 设置 Netbeans、Mercurial 和 BitBucket

发布于 2024-12-03 17:57:38 字数 1417 浏览 0 评论 0原文

我设置了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

末骤雨初歇 2024-12-10 17:57:39

您可以将您的存储库设置为 https。我已经尝试过并且有效。

default-push: https://[email protected]/myaccount/myrepo
default-pull: https://[email protected]/myaccount/myrepo
username: My Name <[email protected]>

You can setup your repo as https. I already tried and it works.

default-push: https://[email protected]/myaccount/myrepo
default-pull: https://[email protected]/myaccount/myrepo
username: My Name <[email protected]>
少女情怀诗 2024-12-10 17:57:39

您需要在存储库或 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文