为git迁移规划存储库布局 [英] Planning repository layout for git migration

查看:58
本文介绍了为git迁移规划存储库布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有一个大型(30K提交)SVN仓库,我正在转换为git。我们的代码库目前有一个共同的(核心)代码集,以及两个独立的基础(Java和.NET)。这允许我们共享通用代码,并且在将构建推送给仅支持两种语言之一的客户时使用不同的语言。



SVN存储库目前大量使用svn:externals来产生使用公共代码的结帐时的特定布局,以及特定于语言的代码。



存储库布局的精简版本如下:

 核心
+
+ - >课程
+ - > public_html
+>管理员
+>网站
+>图片
+> javascript
+>款式

Java
+
+ - > public_html
+> web
+>包括
+>代码


.NET
+
+ - > public_html
+> ; web
+>包括
+>代码

从SVN中的主干结帐,我会在磁盘上获得上述布局,但是如果我签出子文件夹(Java或.NET),svn:externals会给我以下布局:

  Java / .NET 
+>类别
+> public_html
+> admin
+> web
+>代码
+> javascript
+>图片
+>包括
+>样式
/ pre>

这个w生病也让我编辑该文件夹中的代码,并做一个签入将提交到正确的地方仓库。



我的问题是这是否可以实现在git中,使用子模块或其他方法,或者如果我们需要重新思考我们的整个布局,以及如何实现我们想要完成分支的签出以创建构建时所需的内容。如果我们可以用子模块来做到这一点,我应该遵循标准的子模块教程,还是有更深入的东西我应该看看?



感谢!

解决方案

你不会得到与子模块完全一样的目录结构,因为每个目录结构都将位于家长回购。

即,你会得到

  Java 
+
+ - > public_html
* - >核心
+
+ - > public_html

(而不是一个混合的' public_html ')



子模块(您可以直接在其中进行修改,详见子模块的真实性质 a>)。

但是请保持
git子模块与 svn:externals 完全不同。



签出了Java回购协议(引用了它的Core回购协议),我将使用符号链接(可在Unix或Windows上使用)重新创建正确的目录结构。


I currently have a large (30K commits) SVN repository that I am in the process of converting to git. Our codebase currently has a common (Core) set of code, as well as two separate bases (Java and .NET). This allows us to share common code as well as having different languages for when we push a build to a customer who will only support one of the two languages.

The SVN repository currently makes heavy use of svn:externals to produce a specific layout upon checkout that uses the common code, as well as the language specific code.

A stripped down version of the repository layout is as follows:

Core
 +
 +-->classes
 +-->public_html
     +>admin
     +>web
       +>images
       +>javascript
       +>styles

 Java
 +
 +-->public_html
     +>web
       +>includes
       +>code


 .NET
 +
 +-->public_html
     +>web
       +>includes
       +>code

Currently when I checkout from trunk in SVN, I will get the above layout on disk, however if I checkout a subfolder (Java or .NET), svn:externals will give me the following layout:

Java/.NET
+>classes
+>public_html
  +>admin
  +>web
    +>code
    +>javascript
    +>images
    +>includes
    +>styles

This will also let me edit the code in that folder, and doing a checkin will commit to the correct places in the repository.

My question is whether this is going to be achievable in git, using sub-modules or some other method, or if we need to re-think our entire layout and how to achieve what we want when it comes to doing a checkout of a branch to create a build. If we can do this with sub-modules, should I be following the standard sub-modules tutorials, or is there something more in-depth that I should look at?

Thanks!

解决方案

You won't get that exact directory structure with submodules, because each one will be in its own directory within the parent repo.
Ie, you would get

Java
 +
 +-->public_html
 *-->Core
       +
       +-->public_html

(Instead of one mixed 'public_html')

I would still recommend submodules (and you can make modification directly in them, as explained in the "True nature of submodules").
However keep in that git submodules are quite different from svn:externals.

Once you have checked-out the Java repo (with a reference in it to the Core repo), I would re-create the correct directory structure with symlinks (available on Unix or Windows).

这篇关于为git迁移规划存储库布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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