git one local branch synchronizing with multiple remote branches: how to?
-
I have one application that I sold to multiple clients. Each client has his own dedicated application (on Heroku). The applications of these customers only differ by 3 config files: database.yml, aws.yml and corporate.rb Locally, I have one master branch and as many other local branches as I have customers. I need these local branches to store the 3 config files of each customer. Every time I make a change on the master, I merge it with every customer branches and push them one by one to Heroku. This is quite heavy... Following suggestion of this post: http://stackoverflow.com/questions/849308/pull-push-from-multiple-remote-locations, I created one remote grouped branch and hacked my config file so that this branch is associated to multiple urls. The problem is that when I try to push it, It refuses to do it because the remotes are not correctly synchronized. If I force the push, it overwrites my config files, which is not a solution either. I tried to include these config files in .gitignore, but it keeps pushing them. Any idea to solve this issue? Thanks!!!
-
Answer:
I solved the issue by using Heroku's environment variables. Actually, I don't have to set any variable to use them. I just use the APP_NAME variable and set my config for each app in an initializer file: # Custom values case ENV['APP_NAME'] when 'pgp' CORPORATE_NAME = 'PGP Development' S3_BUCKET = 'pgpdevelopment' when 'anchor' CORPORATE_NAME = 'Anchor Group' S3_BUCKET = 'anchorgroup' when 'corionl' CORPORATE_NAME = 'Corio NL' when 'masterproj' CORPORATE_NAME = 'Corporate Demo' when 'adg' CORPORATE_NAME = 'ADG' end #Default values CORPORATE_NAME ||= ENV['APP_NAME'] DEPARTMENT_SELECTION ||= false GEOSCOPE_SELECTION ||= false GEOSCOPE_DEFAULT ||= 'world' DEPARTMENT_DEFAULT ||= 'all' S3_BUCKET ||= ENV['APP_NAME'] S3_CREDENTIALS = { :access_key_id => my_key_id, :secret_access_key => my_access_key } if Rails.env == "production" S3_CREDENTIALS[:bucket] = S3_BUCKET else S3_CREDENTIALS[:bucket] = "#{S3_BUCKET}_dev" end Thx for putting me on the right track!
ndemoreau at Stack Overflow Visit the source
Other answers
I would not version control customer specific artifacts in your repository. Do a transform elsewhere and then push from there to heroku. You need an "admin" repo.
Adam Dymitruk
Related Q & A:
- Is it better to use many records in one table, or to use multiple tables?Best solution by Stack Overflow
- how to apply an older patch in local GIT repository?Best solution by makandracards.com
- How to get local branch up-to-date with remote?Best solution by Stack Overflow
- Does any one know how to join the Operating engineers local union #3?Best solution by Yahoo! Answers
- How do I scan multiple pages and email them into one file?Best solution by h30434.www3.hp.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.