preserving certain files when merging branches

in our code repository, we have a few files (example: system.conf) that will be different in each branch/environment.  I have branches: master, devl, acpt and environments: prod, devl, acpt. Each environment will have it’s own system.conf and servlets.conf. I was going to create 3 files for each environment. system.conf.prod, system.conf.devl, system.conf.acpt. Either when pulling the branch to the application server (using git pull), depending on the environment I am in, I would like the system.conf to be replaced by the right system.conf.<env>. What is the best way to accomplish this. One option would be to include the git in a wrapper script followed by a copy of the right file. Just wondering if there is a different/better options. 

Hi @ravi567,

The best option for preserving system specific files would be to use a .gitignore file. This would allow you to use the same filename and just not have it included in the Git repository so that you can have it be different on each system. If you want to distribute an example, you could then create a sample file which isn’t ignored and has instructions for creating the environment specific file.

Thanks!