1

We have for branches master, edge, test, devl for our applications that runs on four urls prod.app.com, edge.app.com, test.app.com, devl.app.com

Our work flow is devl -> test -> edge -> master

Currently we are facing an issue in which some configuration that changes on all branches. We have some files that are to be different on 4 branches eg site urls, db settings etc. So how we can easily manage these files through git. We can't add it in Git ignore as we can't able to access web server frequently to change directly in web server.

Also we have around 14 configuration files (its for 14 differnet languages) also these configuration files have frequent code changes so we cant ignore these files. Also we cant merge files as specified in this link because changes are there and we need to push these changes to server

So currently when we need to change the configuration of edge we are changing configuration of devl and then branch pushing to test and then to edge. So during this process our devl and test will be down so please let us know the best method we can implement.

Community
  • 1
  • 1
Geo
  • 121
  • 2
  • 7
  • possible duplicate of [Branching: different config files for release/development](http://stackoverflow.com/questions/9636492/branching-different-config-files-for-release-development) – nwinkler Jul 29 '15 at 11:54

1 Answers1

1

Using git cherry-pick you can apply the same patch to all branches.

If your devel branches are all childs of the master branch then you could also apply the changes only to master and then git rebase the other ones onto the updated master.

But personally I would not keep the configs together with the other sources. Add them to .gitignore. You can still create another project which contains the config files only.

rudimeier
  • 854
  • 1
  • 8
  • 20
  • @rudemeier I don't know its a stupid question but out of curiosity.. Is it possible to create another branch with config files only and in web-server can we configure to show files both branches? – Geo Jul 29 '15 at 12:15
  • Create a branch with no parents```git checkout --orphan config``` and commit such config file. Then switch to master ```git checkout master``` and get only the config file ```git checkout config -- filename``` – rudimeier Jul 29 '15 at 12:25
  • BTW you could also have a look at ```git submodule```. – rudimeier Jul 29 '15 at 12:29