系统相关
首页 > 系统相关> > linux – 在同一顶级父目录的文件夹中使用多个Git repos?

linux – 在同一顶级父目录的文件夹中使用多个Git repos?

作者:互联网

我正在使用基于Magento-Boilerplate主题(GitHub repo)的神话般的HTML5 Boilerplate并使用我自己的子主题(私人Git Repo)扩展它,在Magento商店(SVN repo连接到Git)上工作.这些都存在于一个www文件夹中,恰好是所有三个项目的顶级目录.我想干净地将所有这些集成到各自的存储库中,但是我发现的单个目录中的多个存储库的唯一解决方案是子模块(我喜欢它的想法,但据我所知,需要每个项目到在主Git仓库的子文件夹中)并将文件符号化(应该工作,但有点乱,而且很烦人跟上).

有没有一个干净的方法来完成这项工作?这是我的文件夹结构的一个例子.我已经说明了每个文件/目录所在的repo – M = Magento,B = Boilerplate,P = Private:

/www
   |-- app [M]
       |-- frontend [M]
           |-- base [M]
           |-- magento-boilerplate [B]
               |-- default [B]
               |-- myprivatetheme [P]
   |-- skin [M]
       |-- frontend [M]
           |-- base [M]
           |-- magento-boilerplate [B]
               |-- default [B]
               |-- myprivatetheme [P]
   |-- .htaccess [M][B][P]
   |-- favicon.ico [M][P]

正如你所看到的,即使没有整个.htaccess和favicon.ico在多个存储库中混乱(我只是gitignore或 – 在Magento和Boilerplate存储库中保持未更改它们并使用我的私有存储库)顶级目录因为Magento将代码和主题拆分为具有www的公共父级的单独文件夹的方式是www.因此,您甚至可以在技术上说app,skin和各种前端文件夹也存在于多个repos中,因为它们必须存在于每个repo中,一直到结构的顶级目录.

sym链接这些回购从单独的文件夹我唯一的解决方案?这不是一个大问题,但我真的很想知道Git是否足够灵活来处理我的案子.看起来modman可能是专门为了解决这个符号问题而创建的.

解决方法:

我确认没有简单的方法将Git repo结构映射到部署结构(这实际上是您的文件夹结构显示的内容:部署到Web文件夹中)

modman”似乎是一种自动化的有效方法,但你需要记住,如果你对其中一个子模块进行任何更改,你需要提交它们,将它们推送到各自的上游,然后转到父git repo ,再次提交并推动.
所有这些似乎都没有被modman考虑在内.

OP Colt McCormack报告研究modgit

modgit is an alternative to the excellent modman tool.
Directly inspired from it, modgit allows you to deploy Git modules physically in your project (no symlinks).
Additionally, you can define include/exclude filters to deploy only files and folders of your choice.

标签:linux,git,magento,git-submodules,symlink
来源: https://codeday.me/bug/20190826/1726368.html