简体   繁体   English

将多个项目的多个存储库组合到Visual Studio 2010中的总体解决方案的单个存储库中?

[英]Combining multiple repositories of multiple projects into a single repository of an over-arching solution in Visual Studio 2010?

Suppose I have two Visual Studio 2010 projects, both in the same solution. 假设我有两个Visual Studio 2010项目,两个都在同一个解决方案中。

One project is a dll library for performing task x. 一个项目是用于执行任务x的dll库。 And the other is a Windows Forms GUI Frontend for that library. 另一个是该库的Windows窗体GUI前端。

Let's also suppose that I started developing both these projects using two different mercurial repositories, (one for each project). 让我们假设我开始使用两个不同的mercurial存储库开发这两个项目(每个项目一个)。

Suppose I wanted to combine these two repositories into one repository of the overarching solution of both projects (without losing any of my commit messages). 假设我想将这两个存储库合并到两个项目的总体解决方案的一个存储库中(不会丢失任何提交消息)。

Would this be possible (or even for that matter a good idea?) 这有可能(或者甚至是个好主意吗?)

You bet! 你打赌! Here's the short answer: https://www.mercurial-scm.org/wiki/MergingUnrelatedRepositories 以下是简短的回答: https//www.mercurial-scm.org/wiki/MergingUnrelatedRepositories

Let's say you have two repositories 假设您有两个存储库

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         3/24/2011   7:33 AM            r1
d----         3/24/2011   7:35 AM            r2

Here's r1: 这是r1:

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         3/24/2011   7:33 AM            .hg
-a---         3/24/2011   7:33 AM         85 file1.txt

Here's r2: 这是r2:

Mode                LastWriteTime     Length Name
----               -------------     ------ ----
d----         3/24/2011   7:35 AM            .hg
-a---         3/24/2011   7:33 AM         89 file2.txt

We'll make create another repository called "merged" by cloning "r1". 我们将通过克隆“r1”创建另一个名为“merged”的存储库。

$>hg clone r1 merged
updating to branch default
resolving manifests
getting file1.txt
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$>cd merged

Now we need to pull "r2" in: 现在我们需要拉入“r2”:

$>hg pull -f ..\r2
pulling from ..\r2
searching for changes
warning: repository is unrelated
2 changesets found
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 1 files (+1 heads)
(run 'hg heads' to see heads, 'hg merge' to merge)

Finally, we need to merge them together and commit the changes: 最后,我们需要将它们合并在一起并提交更改:

$>hg merge
resolving manifests
getting file2.txt
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$>hg commit -m "Merged two both repos"
file2.txt
committed changeset 4:40028ef336d9

All done! 全部做完! Here's our merged repo: 这是我们合并的回购:

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         3/24/2011   7:36 AM            .hg
-a---         3/24/2011   7:36 AM         85 file1.txt
-a---         3/24/2011   7:36 AM         89 file2.txt

Let's see what we've got in history... 让我们看看我们历史上有什么......

$>hg log
changeset:   4:40028ef336d9
tag:         tip
parent:      1:464b7426220c
parent:      3:3b5eba6d03ef
user:        Joe Schmoe <schomej@inter.net>
date:        Thu Mar 24 07:36:58 2011 -0700
description:
Merged two both repos

changeset:   3:3b5eba6d03ef
user:        Joe Schmoe <schomej@inter.net>
date:        Thu Mar 24 07:35:02 2011 -0700
files:       file2.txt
description:
Added second line to second file

changeset:   2:c26449adfb4d
parent:      -1:000000000000
user:        Joe Schmoe <schomej@inter.net>
date:        Thu Mar 24 07:32:52 2011 -0700
files:       file2.txt
description:
Added first line of second file

changeset:   1:464b7426220c
user:        Joe Schmoe <schomej@inter.net>
date:        Thu Mar 24 07:33:47 2011 -0700
files:       file1.txt
description:
Added second line to first file

changeset:   0:51cb60e8a68a
user:        Joe Schmoe <schomej@inter.net>
date:        Thu Mar 24 07:31:59 2011 -0700
files:       file1.txt
description:
Added first line to first file

Success! 成功!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Visual Studio 2010中同时将多个项目添加到单个解决方案 - Adding multiple projects to a single solution simultaneously in Visual Studio 2010 在1个解决方案中的多个项目之间共享资源。 Visual Studio 2010 - Share Resources Across Multiple Projects In 1 Solution. Visual Studio 2010 如何在Visual Studio 2010解决方案中调试多个项目 - How to debug multiple projects within a Visual Studio 2010 solution 使用文本编辑器创建具有多个项目的Visual Studio 2010解决方案 - Create a Visual Studio 2010 Solution with multiple projects from a text editor Visual Studio 2010 1 个解决方案中的 2 个项目 - Visual Studio 2010 2 projects in 1 solution 具有多个项目的Visual Studio解决方案:参考路径 - Visual Studio Solution with Multiple Projects: Reference Paths 创建visual studio解决方案模板 - 多个项目 - Create visual studio solution template - multiple projects 如何在Visual Studio 2010中打开多个项目 - How to open multiple projects in Visual Studio 2010 将多个项目中的多个功能作为单个wsp包部署-Visual Studio 2010支持 - Deploying multiple features from multiple projects as single wsp package - visual studio 2010 support Visual Studio解决方案添加多个项目 - Visual studio solution adding multiple projects
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM