A
A
Anton Shvets2022-03-23 12:47:56
git
Anton Shvets, 2022-03-23 12:47:56

How to create a file in a branch that will not be merged with the master?

In the project, when starting the front, you must specify the response backend branch. Nothing in the master should change.
those. let's say - checkout to the featureA-front branch,
take the /src/backend-branch.js file
and write module.exports = 'featureA-backend' there.
I make several commits to the featureA-front branch, everything is ok.

I finish the task, make the MR into the master, and the /src/backend-branch.js file should not change in the master and generally get into the MR.

How to do it with a minimum of operations and manual work?
One option is a merge hook that will regenerate backend-branch.js, but that doesn't seem very pretty.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dsmoke, 2022-03-23
@dsmoke

use environment variables like this

G
GavriKos, 2022-03-23
@GavriKos

Do not store such settings in the git at all.
Or at the stage of development, put everything in order.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question