-2

In github, I used to code in other branches and then merge it to main branch. When merging branch it every time returns merge conflicts. It is frustrated to solve those conflicts. How to reduce this?

Balaji
  • 7
  • 4

2 Answers2

1

Well as a general practice, after finishing the changes in the new branch you should first merge the main branch into your new branch and resolve the merge conflicts, after which you can merge the new branch into the main branch. This way even if there is any major bug after the merging of main into new branch you need not merge into main, until the bug is resolved and till then the main branch is left intact.

As for the reducing the number of conflicts, I don't know of any shortcuts to that, you'll have to manually fix them, in order to avoid breaking the entire application/program.

Hope it helps ;)

Brownpanda
  • 78
  • 1
  • 9
0

You can use git rerere to record and play back common merge conflict resolutions.

Nick McCurdy
  • 17,658
  • 5
  • 50
  • 82