Home > database >  GIT merge from base branch to "child" branch but maintain some changes in "child"
GIT merge from base branch to "child" branch but maintain some changes in "child"

Time:01-02

I have a base branch with Dolibarr code with custom code. Then I have 2 branches company_a and company_b.

In branch "custom" I make changes to Dolibarr's base code that we want in both companies. Then in each branch I make changes that are only specific to each company.

The problem is when I have to touch core code in company_b and later I make a change for both companies in custom.

If I merge custom to company_b (and it just so happens that I don't get a merge conflict) I lose the changes made in company_b.

How can I deal with this?

According to ChatGPT I could do

git switch company_b
git merge custom
git rebase custom

but

  • Related