1

I have a project based on CodeIgniter..

I have environment config folders such as:

/* this does not get pushed to github, it stays on my development workstation */
/application/config/development
/* this is created from example_changeme, when a new client is created. */
/application/config/production
/* this one is used when creating a new client it houses the "template" of production configs */
/application/config/example_changeme

I have a core repo for github which includes everything except for the following folders:

/application/config/production
/application/config/development
/application/views
/index.php

i have a client repo with branches of each client. These branches have the folders:

/* this is created from example_changeme */
/application/config/production

/application/views
/index.php

on my development workstation i have a folder structure as:

/core/
/client/
  ggg/
  sgaz/

I need to be able to make changes to core_repo and be able to pull down those changes into a specific branch (or all branches within the client repo). An example scenario would be:

I make a code change to a controller under: /application/controllers

Currently: I have to copy/paste or re-clone the core_repo to each of the new sites, and re-create any changes i've had to my views.

Ideally: I would like to simply use a form of "update" to get the changes from core_repo yet, keep applications/views and config/production and index.php in tact.

How can i go about doing such a thing?

NDBoost
  • 10,184
  • 6
  • 53
  • 73
  • I'm having a similar though slightly less complicated problem. I'm i understanding correctly that you have 3 locations where we can find your project in 3 different "variations" with each there own config folder? – bottleboot Feb 15 '12 at 14:07
  • each `/application/client1` folder is its own encased application folder. Although Controllers/models/libraries/helpers are all the same across them right now, there is a possibility they could differ. CI supports multiple applications as shown above, but only by having a custom index.php file for each one in your docroot.. IE: ggg.php, index.php, sgaz.php – NDBoost Feb 15 '12 at 14:10

1 Answers1

1

This is not easy but I'll give it a try.

If I understand correctly, you use a core version of your application across multiple sites/projects. You want to be able to push updates to those site of your core version without loosing any of a projects specific files and folders such as the config files.

Although what you want is a bit more complex a good approach to such a setup is what they suggest what they do in this tutorial. http://nvie.com/posts/a-successful-git-branching-model/

Ignore the files that are different for each project like you do now. Etc..

As for pushing to all the all the client locations, you can do this as suggested in this answer: Git: Pushing to two repos in one command

I'm not sure if that covers it, if not I'll be glad to revisit :).

Community
  • 1
  • 1
bottleboot
  • 1,659
  • 2
  • 25
  • 41