将本地 Mercurial 存储库推送到远程服务器或从本地克隆服务器

发布于 2024-10-09 20:33:11 字数 642 浏览 5 评论 0原文

我有一个本地存储库,现在决定将其推送到远程服务器(例如,我有一个允许 Mercurial 存储库的主机,并且我也尝试将其推送到 bitbucket)。该存储库有很多文件,略多于 200mb。在本地,我可以毫无问题地克隆存储库。

现在我在这个存储库中进行了很多更改,并且我浪费了几天时间试图弄清楚如何让远程服务器克隆我的存储库。我无法让 hgserve 在 LAN 之外工作。我已经尝试了一切。因此,我在远程服务器(主机和 bitbucket 上)创建了一个新的存储库,其中没有任何内容。现在,我将本地的完整存储库推送到这些远程位置。到目前为止,它还没有成功,因为推送操作停留在搜索更改上,并且没有给我任何其他有用的输出。我已经放了大约一个小时了,没有任何变化。

现在我的问题是,就 hgserve 而言,我做错了什么?我可以在本地访问它,但不能远程访问它(通过 DynDns - 我已正确配置它,并且路由器正确转发端口),以便我可以让服务器第一次克隆存储库,然后我将推送到它。我的第二个问题是,假设服务器上的克隆不起作用(例如,如果我要将当前存储库推送到 bitbucket),是否可以在服务器上创建一个空存储库,然后将本地存储库推送到新的远程存储库,可以吗?这是搜索更改问题的根源吗?

在这方面的任何帮助将不胜感激。

I have a local repository that I have now decided to push to a remote server (for example, I have a host that allows mercurial repositories and I am also trying to push to bitbucket). The repository has a lot of files and is a little more than 200mb. Locally, I am able to clone the repository without problems.

Now I have a lot of changes in this repository, and I have wasted a couple of days trying to figure out how to get the remote server to clone my repository. I cannot get hg serve to work outside of the LAN. I have tried everything. So instead, I created a new repository at the remote servers (both at the host and bitbucket) with nothing in it. Now I am pushing the complete repository that I have locally to these remote locations. So far it has been unsuccessful, as the push operation is stuck on searching for changes and does not give me any other useful output. I have let it go for about an hour with no change.

Now my questions is, what am I doing wrong as far as hg serve is concerned? I can access it locally but not remotely (through DynDns - I have configured it properly and the router forwards the ports correctly) so that I can get the server to clone the repository the first time after which I will be pushing to it. My second question is, assuming the clone at server does not work (for example, if I was to push my current repository to bitbucket), is creating an empty repository at the server and then pushing a local repository to the new remote repository ok? Is that the source of the searching for changes problem?

Any help in this regard would be greatly appreciated.

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

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

发布评论

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

评论(5

小傻瓜 2024-10-16 20:33:11

就 hgserve 而言,我做错了什么?

很难说,但是 hgserve 通常不是我在第 3 方服务上创建远程克隆的方式。对我来说,如果没有必要的话,我不会在防火墙上戳一个洞。

在服务器上创建一个空存储库,然后将本地存储库推送到新的远程存储库,可以吗?

是的。这就是我在 Kiln 创建远程克隆的方法。在 Kiln 中创建一个新的空存储库,获取新存储库的 URL,然后从我的计算机推送到它。

这是搜索更改问题的根源吗?

不确定,但此报告表明,非常大的推送可能会产生问题。他们建议推入较小的卡盘(例如一次几转)。另一个考虑因素是您是否可以在没有修订历史记录的情况下生存(您可以从当前版本的文件创建一个新的存储库并推送该存储库吗?该报告还表明身份验证是一些问题的根源(但这似乎是否则

,您需要进行更多调试来尝试将问题隔离到此特定存储库、与远程的连接或远程存储库一些想法:

  1. 听起来您已经尝试了不同的主机,但也许再尝试一个?
  2. 您可以将一个空存储库或另一个存储库从您的计算机推送到远程
  3. 吗?您可以尝试从计算机/网络(例如笔记本电脑和带有免费 WiFi 的本地咖啡馆)访问另一个存储库吗?推送目标仓库还是测试仓库?

what am I doing wrong as far as hg serve is concerned?

Hard to say, but hg serve isn't normally the way I would to create a remote clone at a 3rd party service. For me, I wouldn't poke a hole in my firewall if I don't have to.

creating an empty repository at the server and then pushing a local repository to the new remote repository ok?

Yes. This is how I create a remote clone at Kiln. Create a new empty repo at Kiln, grab the URL for the new repository, and then push to it from my computer.

Is that the source of the searching for changes problem?

Not sure, but this report suggests that a really large push can be a problem. They suggest pushing in smaller chucks (e.g. a few revs at a time). Another consideration is whether you can live without your revision history (are you okay with creating a new repo from the current version of the files and push that repository. The report also suggests that authentication was the source of some problems (but that seemed to be a different error message).

Otherwise, you'll need to do more debugging to try to isolate the problem to this specific repo, your connectivity to the remote, or the remote repo . Some thoughts:

  1. Sounds like you already tried a different host, but perhaps try one more?
  2. Can you push an empty repository or a different repo from your machine to the remote?
  3. Do you have access to another from machine/network (e.g. a laptop and a local coffehouse with free wifi) that you can try to push the target repo or a test repo?
白馒头 2024-10-16 20:33:11

是的,您可以毫无问题地推送到空存储库。当您推送或拉取时,Mercurial 将检查源存储库和目标存储库是否相互关联。这会阻止我将与 OpenOffice 等相关的变更集拉入我的 Mozilla Firefox 克隆中。

新的空存储库与所有存储库相关,因此您始终可以创建一个空存储库并将变更集推入/拉入其中。

事实上,当你

hg clone http://example.net/my-repository

这样做时,这与你做的事情是一样的

hg init my-repository
cd my-repository
hg pull http://example.net/my-repository

,只是不会有默认的路径设置——请参阅 barjak 的评论了解如何做到这一点。

Yes, you can push to an empty repository with no problem. When you push or pull, then Mercurial will check to see if the source and destination repositories are related to each other. That prevents me from pulling changesets related to, say, OpenOffice into my clone of Mozilla Firefox.

A new, empty repository is related to all repositories, so you can always make an empty repository and push/pull changesets into it.

In fact, when you do

hg clone http://example.net/my-repository

then that is the same as doing

hg init my-repository
cd my-repository
hg pull http://example.net/my-repository

except that there wont be a default path setup for you -- see the comment by barjak for how to do that.

昇り龍 2024-10-16 20:33:11

人们需要知道它很好(也是最简单的),只是为了启动一个新的存储库并按照公认的答案所述推动它。

但是,如果您的服务器可以通过 ssh 访问,另一种选择是在 Windows 本地上使用 putty 建立快速反向隧道。它不需要更改您的防火墙。

在 putty 中查找 ssh >>隧道菜单并选择远程按钮进行反向隧道。

或者在 Linux 本地上类似:

ssh -fnNTR <any port you want to forward to your remote>:localhost:<port for local hg serv> <and then here type what you would normally to ssh to your remote ssh sever>

您现在已经绕过了防火墙并且可以克隆!

我应该补充一点,您可以通过将 R 更改为 L(本地)并更改端口号(如果需要)来执行正常的转发隧道进行推送。

People need to know it fine (and easiest) just to init a new repo and push to it as the accepted answer says.

But another option if your server is ssh accessible would be to make a quick reverse tunnel with putty on the windows local. It doesn't require changing your firewall.

in putty look for ssh >> tunnels it the menu and chose the remote button for a reverse tunnel.

Or on a linux local something like:

ssh -fnNTR <any port you want to forward to your remote>:localhost:<port for local hg serv> <and then here type what you would normally to ssh to your remote ssh sever>

You have now bypassed your firewall and can clone!

I should add you can do a normal forward tunnel for pushing to just by change R to L (local) and changing the port numbers if ness.

无法回应 2024-10-16 20:33:11

Hg Mercurial 可以与安全 shell 协议一起使用。有两种路径变体:

$ hg clone localrepo ssh://[email protected]:port/relative_remote_path
$ hg clone localrepo ssh://[email protected]:port//absolute_remote_path

Hg Mercurial can be used with the secure shell protocol. There are two path variants:

$ hg clone localrepo ssh://[email protected]:port/relative_remote_path
$ hg clone localrepo ssh://[email protected]:port//absolute_remote_path
够运 2024-10-16 20:33:11

您可以尝试推送一组变更集。如果内存有问题,这会有所帮助。它还可以帮助您隔离导致问题的变更集。

You could try pushing a set of changesets. This will help if memory is an issue. It might also help you isolate which changeset is causing the problem.

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