简体   繁体   English

Git克隆带有子模块的框架

[英]Git cloning a framework with submodules

I currently have the following situation. 我目前有以下情况。 I have a private project that acts like a framework that I wanna use as the base for a range of other projects. 我有一个私人项目,它的行为就像一个框架,我想将其用作其他一系列项目的基础。 In the root of the project there are a few folders named themes, modules, plugins and some more that were made to make unique changes too. 在项目的根目录中,有几个名为主题,模块,插件的文件夹,还有一些文件夹也进行了独特的更改。 When the clone is made, the main goal is to update and add content to these sub-folders. 创建克隆后,主要目标是更新内容并将内容添加到这些子文件夹。

framework/
 | - config.ini
 | - core.c
 | - module_handler.c
 | - plugin_handler.c
 | - theme_handler.c
 | - modules/
 | - plugins/
 | - public/
      | - images/
 | - themes/
  • I want to be able to update the framework version in each clone. 我希望能够更新每个克隆中的框架版本。 ( important ) 重要
  • I want the framework in the root directory of the clone. 我想要框架在克隆的根目录中。 ( important ) 重要
  • I want the ability to pick commits/changes in the clone and push them back to the framework sometimes. 我希望能够选择克隆中的提交/更改,有时将它们推回到框架中 (would be nice, but I could live with the pain of doing it manually) (会很好,但是我可以忍受手动执行的痛苦)
  • I most not use branches. 我最不使用分支。 They are clearly separated. 它们显然是分开的。

I've been reading a whole day about submodules and I feel that concept would have been perfect. 我整天都在阅读有关子模块的信息,我觉得这个概念会很完美。 Except that it seems they can not live within the root of a new project, since the .git folder is obviously colliding. 除了它们似乎不能存在于新项目的根目录中之外,因为.git文件夹明显冲突。 But I don't know how I would handle it if it can't be in the root directory. 但是我不知道如果不能在根目录下怎么办。 Is there any hack or something I can use? 是否有任何hack或我可以使用的东西?

If I can't get everything, I could live without the ability to easy merge back changes to the framework. 如果我什么都做不到,那么我将无法轻松地将更改合并回框架。

I'm making the assumption that I will always work alone on this thing. 我假设我将一直独自从事此事。 I just want it more organized and self-explained for myself. 我只是想让它自己更有条理和自我解释。

What is the best way to tackle this problem and achieve this functionality? 解决此问题并实现此功能的最佳方法是什么?

git add .
(addig every changes to repo)

git push master master
(update the whole master)

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM