【问题标题】:Mercurial: Create new repository from existing folder in old repository [duplicate]Mercurial:从旧存储库中的现有文件夹创建新存储库[重复]
【发布时间】:2011-04-05 21:20:22
【问题描述】:

可能重复:
Can I split a Mercurial repository?

我有一个包含多个项目的 Mercurial 存储库(当我开始使用 Mercurial 时,这似乎是个好主意......)。

是否可以将项目/文件夹转换为历史完整的新存储库?

提前致谢。

【问题讨论】:

  • 我不确定您在问什么...您是想将一个现有的 Mercurial 存储库拆分为多个新的存储库,还是尝试将多个现有的存储库合并到一个新的存储库中?跨度>

标签: mercurial repository dvcs


【解决方案1】:

您应该可以使用 ConvertExtension 完成此操作,从 Mercurial 转换为 Mercurial。

来自文档:

The filemap is a file that allows filtering and remapping of files and
directories. Each line can contain one of the following directives:

  include path/to/file-or-dir

  exclude path/to/file-or-dir

  rename path/to/source path/to/destination

我用下面的命令行成功了

hg convert ./OriginalRepo ./NewRepo --filemap fm.txt

fm-txt 的样子

include SubProjectFolderName

您可能希望考虑将该文件夹重命名为不是新存储库中的子文件夹。不过我自己没试过。

【讨论】:

  • 谢谢,这似乎是要走的路。 :)
  • 这很好用。非常感谢。 :)
猜你喜欢
  • 2019-02-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-01-08
相关资源
最近更新 更多