I have a Ruby on Rails application, which sends out emails.
In production, I want to use some X SMTP server, but in development I want to use some other SMTP server (thus my configuration file for the SMTP settings is different in the development and production environments)
So I need to maintain 2 configuration files (one file each for the development/production environments' SMTP settings).
As of now, I keep settings for Y STMP in a file on my development machine. I clone the production code from the github repo, modify the working copy with settings for Y SMTP and proceed. Then when I have to push changes to github, I reverse the process. It works, but I'm thinking there should be a better way?
What is the "git way" to handle this sort of "small differences" between development and production code bases?
UPDATE
Per @Mike Axiak, is this the flow that you mean: (presume for simplicity that I'm not using ln
, but using the copy
method)
Both are added to .gitignore
If this is what you meant, is there some way to automate the copying process via git?
Navigate to the repository you just cloned. Pull in the repository's Git Large File Storage objects. Mirror-push to the new repository. Push the repository's Git Large File Storage objects to your mirror.
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Git is easy to learn and has a tiny footprint with lightning fast performance.
Rails already support this kind of thing using the files the configuration/environments directory. Just add your settings in the appropriate file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With