I have a Ruby on Rails application that sends 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 SMTP settings is different in development and production environments)
Therefore, I need to support 2 configuration files (one file for SMTP settings for the development / production environment).
At the moment, I save the settings for Y STMP in a file on my development machine. I clone the production code from the github repository, change the working copy with the settings for Y SMTP, and continue. Then, when I need to make changes to github, I cancel the process. It works, but I think there should be a better way?
What is git to handle such “small differences” between development and production code bases?
UPDATE
Per @Mike Axiak, this is the thread you have in mind: (suppose for simplicity that I am not using ln, but using the method copy)
Configure the source code so that there are 2 settings files on the local computer:
- smtp.settings.prod
- smtp.settings.dev
Both added to .gitignore
To work with a local copy:
- Extract code from github
- Copy smtp.settings.dev to smtp.settings
- Use.
:
- , , smtp.settings.prod smtp.settings
, , git?