-
-
Save richardtape/4065197 to your computer and use it in GitHub Desktop.
I have a standalone git repo (which is on github) which contains my 'framework'. That framework is a | |
load of php/css/js/less files, in several subdirectories. I use that framework in all of my projects. | |
I have another standalone git repo which contains all of my projects. | |
At the moment, if I update the framework, I then have to copy and paste it into all of my projects, | |
overwriting the existing stuff in each project folder. | |
I know! The humanity. Think of the children. But we live in the 21st Century etc. | |
I'm pretty sure I'm "doing it wrong". (or, _doing_it_wrong() for those WP folk reading this). I suspect | |
there's something with git submodules I can do. | |
Can anyone suggest anything I can read or look at to let me get my little head around this? If I sort | |
this out, I'll happily write a blog post about it to help other folk out. |
Hey Anthony, thanks very much for taking the time, I really appreciate it.
The file structure is basically a WordPress installation.
All of my 'projects' - for this instance - are themes. And my framework is, well, my WP theme framework. The bottom line is, I use my theme framework as a parent theme and all of the 'projects' are child themes of that. So when I update the parent theme (the framework), I don't need to touch the child themes (the projects). That's all hunky dory.
However.
Because of the way I work - with different people/companies for different projects - I have several WordPress installs, naturally in different locations.
So I'm trying to abstract my framework from those installs and keep the framework in one central location. What I kind of need is a symlink from my framework to each wp-content/themes/ folder in my different WordPress installations.
Does that make any sort of sense?
If you don't modify the framework files to create the "child theme", what about adding Git submodule outside of root then a hook (which is invoked when you update the submodule) which moves/copies the now updated files to their final location?
Could you not submodule the framework, which shoudl make it independent from the project. Something like...
Do you have a directory/file structure I can take a peek at?