开发者

Git subprojects?

I'm working on a couple of different Joomla add-ons but want to keep them as separate git repos as they have different development teams (and even organisations). However, I'd also like to keep them as a single directory sharing the same Joomla base (which is ignored by .gitignore). Because of Joomla's structure, this can be a bit complicated as it has the following structure:

/joomla/  
|--/administrator/  
|--|--/components/  
|--|--|--/c开发者_Go百科omponent_a/  
|--|--|--/component_b/  
|--|--/language/  
|--|--|--/en-GB/  
|--|--|--|--/component_a_lang.ini  
|--|--|--|--/component_b_lang.ini  
|--/components/  
|--|--/component_a/  
|--|--/component_b/  
|--/language/  
|--|--/en-GB/  
|--|--|--/component_a_lang.ini  
|--|--|--/component_b_lang.ini  

I know I could make a central repo and use branches for each sub project and just be careful with using the right remote for the right subproject. But is there an easier way (submodules?) to keep all of the subprojects in the same directory so if I wanted to copy the whole thing for testing, I wouldn't have to switch branches and play with copy-pasta?


Normally I would recommend using submodules, but in this case they're not really appropriate because of the structure of the project.

A submodule is placed in a single directory, so you can't really spread them out over the whole project.

One possible sollution would be to put all those files in one directory, and use symlinks to put them in the right place. But this has several drawbacks. You would need to recreate all the symlinks on each repository, and it can also cause problems for windows users.


As @Ikke says, the way the code is spread across directories makes it cumbersome to use submodules to hold these.

I think I'd just use separate branches for the separate tracks of development. They're "features", right? More or less? So it's probably fairly appropriate to treat them like feature branches.

If your central repository is being served by gitolite, you can set up access on a per-branch basis to separate users and groups. You can make it so everyone can read every branch (important for testing), but only blessed groups can push to their own branch.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜