开发者

tortoise hg clone two separate mercurial projects to the same directory

开发者 https://www.devze.com 2023-03-02 02:23 出处:网络
I wanted to combine two projects from separate remote mercurial repositories into the same local directory (one is a framework, the other my code).

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号