如何在Visual Studio解决方案中使用不同布局处理Git子模块? [英] How to deal with Git Submodules in Visual Studio solutions with different layout?

查看:187
本文介绍了如何在Visual Studio解决方案中使用不同布局处理Git子模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用Visual Studio 2010(使用C#)进行开发,不久前从SVN迁移到GIT.现在,我们尝试将我们的存储库(相当大-约30.000个文件)拆分为多个git存储库-每个解决方案一个. 这些解决方案共享一些项目,其中大多数是我们内部开发的库,并且希望从所有解决方案中添加.

We develop with Visual Studio 2010 (in C#) and migrated a while ago from SVN to GIT. Now we try to split up our repository (which is quite big - ~30.000 files) to many git repositories - one for each solution. The solutions share some projects, mostly libraries we develop in-house and like to add to from all the solutions.

新存储库的布局平坦.每个项目一个子目录(共享项目是子模块). 在大型的旧仓库中,项目位于树状结构中.

The new repositories have a flat layout. One subdirectory for each project (shared projects are submodules). In the big old repo, the projects are in a tree structure.

子模块中的外部引用出现问题.在新的存储库中,引用项目的路径可能是"...... libs \ someproject",而在新布局中,正确的路径将是".. \ someproject".

The Problem occurs with external references in the submodules. In the new repos, the path to a referenced project may be "......libs\someproject", while in the new layout the correct path would be "..\someproject".

我们已经对此进行了一些编辑大战,并且不热衷于此.

We already had some edit wars concerning this and are not keen on more.

半熟的解决方案,我能想到的:

Half-baked Solutions I could think of:

  • 使用... csproj.user中的参考路径",并将此文件从版本控制中排除(必须为每个开发人员重做,并在每次重新监控后重做)

  • use "Reference Paths" in ...csproj.user and exclude this file from version control (has to be redone for each developer and after each reopsitory cleanup)

针对每种情况使用分支,并尝试教每个人真正的"提交应该去的地方和环境变化"的提交应该去的地方(子模块已经不是最简单的概念了……)

use branches for each situation and try to teach everyone where "real" commits should go and where "environment-change" commits should go (submodules are already not the simplest concept...)

嵌入二进制文件而不是子模块(但是对子模块进行更改又如何呢?不同的log4net版本又如何呢?)

embed binaries instead of the submodules (but what about developing changes to the submodules? what about different log4net versions?)

有人知道理智的解决方案吗?

Does anyone know of a sane solution?

推荐答案

由于您正在寻求一个理智的解决方案,因此我只能建议您考虑设置自己的NuGet服务(请参见http://www.MyGet.org 以获得灵感)

Since you are asking for a sane solution, I can only advise you to look into setting up your own NuGet service (look at http://www.MyGet.org for inspiration)

http://nuget.codeplex.com/

这篇关于如何在Visual Studio解决方案中使用不同布局处理Git子模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆