R
R
RJs452015-12-30 13:12:04
git
RJs45, 2015-12-30 13:12:04

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

2 answer(s)
S
Sergey Gladkovskiy, 2015-12-30
@SMGladkovskiy

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

R
Rostislav Grigoriev, 2015-12-30
@crazyzubr

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 question

Ask a Question

731 491 924 answers to any question