views:

46

answers:

1

Hi,

I have a web app under source control in git. I have different css files for different customers as well as images and other theme specific things. And also custom reports... Beside the theme things every other aspect of the app stays the same. What would be a recommended way to keep the app as well as the theme information under source control in git. Should I use branches for the theme and the reports or submodules... During development I would like to like my customers theme to to my dev branch and do changes that I commit to my customer specific theme...

Is something like the possible with GIT?

A: 

Branches are one way to do it, but since Git is a DVCS, you need to deals with the publication aspect as well (which is orthogonal to branching): what to push to another repo and where?.
Meaning if you start by managing branches for each client, you really need to remember:

  1. to update to branches with the common code (git rebase --interactive) to replay client-specific commits on top of common development commits (which are on the 'dev' branch foir instance).
  2. to push the right branch to the right remote repo in order to publish the right changes.

For this kind of development structure (one common module, several client-specific modules), I would consider a component approach and use git submodules.

  • one independent repo for all the common code
  • one repo per client for al the css, report and theme files
  • one parent repo per client which would aggregate the right versions of the rights submodules in order to build, and publish the client web app.
VonC
Thanks for your answer I will give it a try. Is there a chance to extract a submodule out of existing files within the common module repository?
server info
@server: I believe so. See http://stackoverflow.com/questions/3076629/creating-a-submodule-in-a-git-project/3076862#3076862 for a start.
VonC