Mercurial - HTTPS 还是 SSH?

发布于 2024-09-25 22:03:33 字数 333 浏览 1 评论 0原文

我已将内部代码库切换为使用 Mercurial,并带有托管远程存储库。我读到,通过 SSH 使用 Mercurial 比使用 HTTPS 更快,因为数据在发送之前已被压缩。但是……与 HTTPS 相比,设置起来相当痛苦,尤其是在 Windows 上。

对于那些经常在大型项目中使用这两种密钥的人来说...

  1. 性能增益值得为每个用户设置公钥/私钥而头痛吗? 以及处理其他挑剔的事情 配置问题?
  2. 有没有甚至 显着的性能提升?我 还没见过更小的 项目。
  3. SSH 更安全吗?
  4. 您会执行一项使用其中一个的政策吗? 超越另一个,或者让每个 开发商选择?

I have switched our internal codebase to use Mercurial, with a hosted remote repository. I've read that using Mercurial over SSH instead of HTTPS is faster because the data is compressed before it is sent. But... compared to HTTPS, it's quite a pain to set up, especially on Windows.

For those of you who have used both regularly on large projects...

  1. Is the performance gain worth the headache of setting up public/private keys for each user,
    and dealing with other finicky
    configuration issues?
  2. Is there even
    a noticeable performance gain? I
    haven't seen one on smaller
    projects.
  3. Is SSH more secure?
  4. Would you enforce a policy of using one
    over the other, or let each
    developer choose?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

傲性难收 2024-10-02 22:03:33

是的,对于非常大的存储库,建议您使用 SSH 作为大型存储库的 Mercurial。 Mercurial 能够压缩通过 ssh 和 https 发送的数据,因此您可以更快地推送和拉取。另外,默认情况下,Mercurial 在通过 SSH 发送或检索数据时不使用压缩。您需要通过配置启用它。

有两种方法可以做到这一点:

  1. 告诉 Mercurial 要运行哪个 SSH 命令
  2. 在 ~/.ssh/config 文件中指定压缩

In.hgrc

# Use compression
ssh = ssh -C

要在 SSH 配置文件中指定它,请编辑 ~/.ssh/config

总而言之,HTTPS设置很简单。如果你有它,就使用它,除非你要编写兆吨级的框架。

Yes for a very large repository, it is recommended that you use SSH as Mercurial for large repo. Mercurial is able to compress data being sent for both ssh and https, so you can push and pull faster. Also, by default, Mercurial does not use compression when sending or retrieving data via SSH.You will need to enable it via configuration.

There are two ways you can do this:

  1. Tell Mercurial which SSH command to run
  2. Specify compression in your ~/.ssh/config file

In.hgrc

# Use compression
ssh = ssh -C

To specify it in your SSH config file, edit ~/.ssh/config

All said, HTTPS setup is easy. If you have it, just use it, unless you are going to write mega ton frameworks.

渡你暖光 2024-10-02 22:03:33

两者都可以正常工作;选择对你来说更容易的事情。

HTTPS 还会在加密之前进行压缩,因此这不是什么大问题。我看到的唯一真正的区别是,克隆可以通过 HTTP 中止巨大存储库,但人们可以随时重试。

我个人喜欢使用 https 作为只读设置,以便人们可以查看/浏览/克隆,然后使用 ssh 进行所有写入,并允许从 ssh 克隆/拉取。

许多人开始使用 ssh 访问,因为他们已经拥有每个人的 UNIX 用户帐户,因此不需要额外的设置。

如果您已经有适合您的 https,请坚持使用。

Either works just fine; go with whatever is easier for you.

HTTPS also does compression before encryption, so that's not much of an issue. The only real difference I've seen is that clones can abort for huge repos over HTTP, but folks can always re-try.

I personally like using https as a read-only setup so people can view/browse/clone, and then using ssh for all writing, and allowing clone/pull from ssh too.

Many folks start with ssh access because they already have UNIX user accounts for everyone, so there's no additional setup required.

If you already have https working for you, just stick with it.

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