简体   繁体   中英

Git Workflow, sub modules, repo's and branches.. OH MY

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?

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 :).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM