tortoise hg 将两个独立的 Mercurial 项目克隆到同一目录

发布于 2024-11-04 02:09:01 字数 225 浏览 8 评论 0原文

我想将两个项目从单独的远程 Mercurial 存储库合并到同一个本地目录中(一个是框架,另一个是我的代码)。

我的想法是简单地将它们克隆到同一个工作目录,但这会使用 tortoise hg 生成错误abort:destination 'C:\Workspace\project' is notempty

这是解决这个问题的正确方法吗?如果是的话,有人知道如何让它发挥作用吗?

I wanted to combine two projects from separate remote mercurial repositories into the same local directory (one is a framework, the other my code).

My thoughts about doing this were to simply clone them both to the same working directory but this generates the error abort: destination 'C:\Workspace\project' is not empty using tortoise hg.

Is this the right way to approach this and if so does anyone know how to get this to work?

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

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

发布评论

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

评论(1

混吃等死 2024-11-11 02:09:01

首先,您确定要这样做吗?在合并后,如果不从两个“项目”中获取所有内容,就无法安全地推回原始来源。

换句话说,它们实际上成为一个项目,并且将其拆分回来并不容易。

您应该考虑使用子存储库,这是Mercurial 处理这类事情。


话虽如此,要合并两个不同的存储库,您需要将一个存储库拉入另一个存储库。

换句话说,您将执行以下操作:

  1. 克隆其中一个项目
  2. 拉入新克隆,并指定第二个项目的 URL。您需要强制拉取,否则它会抱怨不是同一个存储库。
  3. 可选:将一个或两个项目移动到它们自己的子目录中,以在目录结构中将它们分开
  4. 合并两个头以将它们组合成一大组文件

如果其中任何一个不清楚,请留下您的问题的评论,我将相应地更新/编辑。

First of all, are you sure you want to do this? There's no way to safely push back to the original sources without getting everything, from both "projects" after you have combined.

In other words, they effectively become one project, and it won't be easy to split it back up.

You should consider using sub-repositories which is the typical way that Mercurial deals with these sorts of things.


Having said that, to combine two distinct repositories, you need to pull one into the other.

In other words, here's what you would do:

  1. Clone one of the projects
  2. Pull into your new clone, and specify the URL to the second project. You will need to force the pull, otherwise it will complain about not being the same repository.
  3. Optionally: Move one or both of the projects into their own sub-directories, to separate them in the directory structure
  4. Merge the two heads to combine them into one big set of files

If any of this was unclear, please leave a comment with your questions and I'll update/edit accordingly.

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