tortoise hg clone two separate mercurial projects to the same directory
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:
- Clone one of the projects
- 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.
- Optionally: Move one or both of the projects into their own sub-directories, to separate them in the directory structure
- 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.
精彩评论