Use git To Manage Joomla Templates

I’ve been thinking of a way to easily version control all the Joomla templates we have developed.

The issue isn’t so much that we have a lot of templates. It’s when I want to update a common file to all templates. We currently have 31 templates so that means I have to go through 31 directories and update a single file. It would make sense to change one file and merge it into all the templates.

This is where git & it’s branches comes in. One repository with the master branch that has the common files and the base template that all our templates are based on. Then when we need a new template we create a new branch. As branches never need to be merged back into the master I’d achieve the following:

  • Change common file in master branch, can switch branch to a template and pull in the change made in master, go through each template/branch applying the change – would probably be able to script this.
  • When creating a new template, switch to master and create a new branch.
  • When in a branch can push the changes upto the server instead of having to use winscp to copy from local to remote.
  • The biggest one is being able to “undo”, version control.

Also using GitHub makes for easy tracking of what people are up to as well

Interested in people’s comments or feedback.

  • http://www.jeevidee.nl Jeroen

    Interesting idea. Did it work for you?

    I’m currently investigating how one Joomla (and other open source frameworks in generals) code base can be used to create (custom) websites for different clients.

    The problem I see now is that customization will conflict with external updates from the community. I think your problem is a subset of this problem; I could also think of problems on updating third party plugins.

    I’m curious if you had the above described problem and if you have solved this with the use of GIT.

    Jeroen

  • http://nicholasorr.com Nick

    Hi Jeroen,

    I haven’t even sat down to implement this, simply has been high enough of a priority to be done. Everyday that goes by is actually a day closer to starting MagnitudeCMS.

    Joomla has been great and kudos to the dedicated community that has produced it. The latest version 1.5 has nearly got to where I’d like it to be. I feel the next version will be right up there in terms of control over the meta data. We’ll see I guess.

    Also Habari looks quite interesting…

  • hostforjoomla

    Thanks, this is very useful