How can we do auto merge for common files in git

Viewed 31

Development is going on parallel two branches for eg. we have patch-1 and patch-2 branches. patch-2 branch is base branch of patch-1 and i have some common files in both branches. if i do any change in patch-2 some 'x' file and this changes also required for me into patch-1 'x' file. all this activity doing manually now. please can someone help is there any auto merge option for this to avoid doing manual?

1 Answers

The idea is to split your change/commit into two:

  • one limited to the common files (one commit)
  • one specific to patch-2 (one commit)

You can then git cherry-pick the first commit from patch-2 to patch-1 branch.
That is not a fully automated process, but at least you would reapply the exact same modifications through that operation.

Related