如何在不丢失历史记录的情况下从一台 Mercurial 服务器迁移到另一台 Mercurial 服务器?
我有一个项目,我使用 Bitbucket 作为我的 HG 服务器,但我最近发现,作为一个单独的开发人员,我可以免费使用 Fogbugz/Kiln。我想将我的文件移至 Kiln,但我不想丢失我的历史记录。我确信有一个非常愚蠢的简单方法可以做到这一点,但我只是不知道。我该怎么做?
谢谢!
I have a project where I'm using Bitbucket as my HG server, but I've recently discovered that as a lone developer I can use Fogbugz/Kiln for free. I want to move my files into Kiln but I don't want to lose my history. I'm sure there's a dead-stupid easy way to do it, but I just don't know. How do I do this?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
创建新的项目存储库,并使用原始存储库的当前副本执行以下操作:
hg push new-repo-path
。然后您将来就可以使用新路径。您可以删除 bitbucket 存储库。
使用 Mercurial,所有历史记录都位于存储库的每个副本中,包括您的本地副本。
Create the new project repo and do the following with your current copy of the original repo:
hg push new-repo-path
.Then you use the new path in the future. You can delete the bitbucket repo.
With Mercurial, all history is in every copy of the repository, including your local copies.
由于您已经在使用 Mercurial。我只是好奇,在 Fogbugz/Kiln 上克隆您的存储库还不够。
当然,这不会复制您的每个存储库的 hgrc 文件。您需要单独执行此操作。
另一种方法是使用捆绑包。
第三种方法是从 bitbucket 存储库推送或拉取到fogbugz 存储库。
请参阅:https://www.mercurial-scm.org/wiki/TipsAndTricks。
在这里重现:
可以存储一个默认的推送 URL,当您仅键入“hg Push”时将使用该 URL。编辑 hgrc 并添加如下内容:
Since you are already using Mercurial. I was just curious, shouldn't cloning your repository on Fogbugz/Kiln be sufficient.
Of course, this won't copy your per-repository hgrc file. You will need to do that separately.
Another approach is to use bundle.
Third approach is to push or pull from bitbucket repo to fogbugz repo.
See: https://www.mercurial-scm.org/wiki/TipsAndTricks.
Reproducing it here:
It is possible to store a default push URL that will be used when you type just 'hg push'. Edit hgrc and add something like:
其他答案已经解释过,在创建新的空存储库后,您可以使用
hg push http://example.com/hg/newrepo
。 (请注意,一旦您将一些更改推送到其中,它将来只会接受来自相关存储库的更改。)您似乎还想知道如何配置本地存储库以默认推送到该位置,无需每次都指定 URL。您可以通过编辑 默认位置来完成此操作 在存储库的
.hg\hgrc
文件中。它是一个文本文件,可以使用记事本或任何其他文本编辑器打开。The other answers have already explained that right after creating a new empty repository, you can push your changes into it with
hg push http://example.com/hg/newrepo
. (Note that once you have pushed some changes into it, it will only accept changes from related repositories in the future.)What you also seem to be wondering about also is how to then configure your local repository to push to that location by default, without needing to specify the URL every time. You can do that by editing the default location in the
.hg\hgrc
file of your repository. It is a text file that you can open with notepad or any other text editor.