I use git (via GitHub) for version control in my projects. I'm still new to this, but I would like to know how to keep css and js files synchronized between environments.
Example: Say I'm writing a js script on dev. I am pleased with my work and I insist on testing. Well, for testing, I would like to get a mini version / compressed version. How could I accomplish this without a lot of service tasks? What are you guys doing? I assume this is part of a kind of deployment script that would compress the code and paste it into any environment that I specify.
Another question arises: how are my header files (and / or footer ) in my project? If my dev has:
<link rel="stylesheet" href="<?php echo base_url(); ?>css/main.css">
and my testing has:
<link rel="stylesheet" href="<?php echo base_url(); ?>css/main.min.css">
This is all fine, but what if I need to make changes to my title? How to separate all this from each other? If I make changes to my title and click on testing or production, I would lose .min from this line.
Currently, what I am doing to deploy updates is just git pull origin [branch] from the command line inside the environment I want to update.
Again, I am looking for the best practice, no matter what it requires. Thanks!
source share