A
A
Andrey Salnikov2016-12-24 14:23:18
git
Andrey Salnikov, 2016-12-24 14:23:18

How to merge branches but not merge multiple files?

I am working on a website. You have to work in 2 different places on the local server. Accordingly, the configs are different. I made 2 different branches. Is it possible to merge changes of all files except configuration ones?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor, 2016-12-24
@Shshzik

Usually they make a file with an example settings that is stored in Git, after cloning it is copied and renamed to the desired name for the configuration, this file is ignored.
Thus, each platform has its own config and there is no need to dance with the merge, and even more so, there is no need to create a separate branch just for the sake of it.
Example:
/app/config.sample.php -> /app/config.php
.gitignore:
/app/config.php
Real project example: Laravel and its .env.example which is copied and renamed to .env which is ignored .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question