Skip to content

Instantly share code, notes, and snippets.

@richardtape
Created November 13, 2012 10:56
Show Gist options
  • Save richardtape/4065197 to your computer and use it in GitHub Desktop.
Save richardtape/4065197 to your computer and use it in GitHub Desktop.
Workflow
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.
@richardtape
Copy link
Author

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?

@anthonysterling
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment