Answer the question
In order to leave comments, you need to log in
How to store different files for different branches in git?
There is a repos with two branches - dev and master, which are pulled to dev.site.ru and site.ru, respectively.
The task is as follows: to display different logos for the prod and dev copies of the site.
It is clear that you can do this in code (based on $SERVER['host'] set the desired file name). But is it possible to somehow do this through git - so that the same file is different in different branches?
Answer the question
In order to leave comments, you need to log in
If your branches do not merge, then yes. If they merge, then put two files with different names and choose the right one from the environment. For example: logo-master.png and logo-dev.png
You can add a logo to .gitignore and load different logo.png files into your site copy accordingly. And in order not to lose the logo, you can store it in a turnip with a name like logo.png.example
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question