GIT嵌套存储库:Composer vs. SubModules vs. Subtree vs.?

 zzzzzzzzssss 发布于 2023-01-16 08:23

我终于在我的工作流程中加入了GitHubComposer依赖管理.这绝对是一个巨大的进步,虽然我仍然对GIT管理"嵌套"家属感到困惑.

当我使用一个很棒的Wordpress Stack ROOTS/BEDROCK时,我的简化目录结构如下所示:

|-- /project
|   |-- /.git                    // git repository for the skeleton/stack of the project
|   |-- composer.json            // list of dependencies, most of them are my own repositories on GitHub
|   |-- /vendor
|   |   |-- /php-dependency-1    // 3rd party dependencies not directly related to Wordpress
|   |-- /web
|   |   |-- /app                 // acts as "wp-admin" folder
|   |   |   |-- /mu-plugins       
|   |   |   |   |-- /SUBREPOSITORY-1    // my own framework feature, public, GitHub
|   |   |   |   |-- /SUBREPOSITORY-2    // my own framework feature, public, GitHub
|   |   |   |-- /plugins
|   |   |   |   |-- /SUBREPOSITORY-3    // my own plugin, public, GitHub
|   |   |   |-- /themes
|   |   |   |   |-- /SUBREPOSITORY-5-PARENT-THEME    // parent theme used on my framework, public, GitHub
|   |   |   |   |-- /SUBREPOSITORY-6-CHILD-THEME     // work for client, private, BitBucket
|   |   |-- /wordpress           // Wordpress CMS
|   |   |   |-- /wp-admin
|   |   |   |-- /wp-includes

"子库"在我composer.json的项目根目录中定义,并从GitHub下载composer install.到现在为止还挺好.

但!我希望能够调整我的parent-theme一些mu-plugins,我需要能够从我的每个项目中推送/提交它们.如你所知,没有wordpress安装,你无法真正测试wordpress主题......

那么......走哪条路?有很多关于这个主题的帖子,其中大多数都提到了SubModules,但是如果我正确地理解了Composer,它们就会彼此冲突.

只是使用嵌套的.git存储库看起来很适合我的情况,尽管它似乎不起作用 - 如果我尝试推送/提交嵌套的repo,或者"一切都是最新的"或者我得到的消息Your branch is ahead by 1 commit. 如此只是"嵌套它"是不是一个人?

提前谢谢,对于这个问题的一点点混乱的语气感到抱歉,我在主题中淹了一点.:) 任何帮助将非常感激.

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有