1

There are two developers working on branches dev1 and dev2, respectively, and usually every time one of them commits a change they do a PR into a common dev branch.
Both developers have made a bunch of big changes, some of which may affect the same files.

Developer 1 has done a PR and merged their changes into dev. Now Developer 2 wants to merge their changes into dev as well but is worried there will be conflicts.

Rather than just doing a PR from dev2 into dev, what's the best way for Developer 2 to see what the result of this merge will be?
For example, should they checkout dev2 locally and do a git fetch from dev, and then fix any merge conflicts? Or do a git merge from dev2 into dev?

Christian
  • 4,902
  • 4
  • 24
  • 42
gkeenley
  • 6,088
  • 8
  • 54
  • 129
  • "what's the best way for Developer 2 to see what the result of this merge will be?" → by performing the merge. – knittl Jun 15 '23 at 22:02

1 Answers1

2

This is the procedure I would recommend:

  1. Dev2 merge from common dev to dev2 branch.
  2. Solve conflicts locally.
  3. Do a pull request from dev2 branch to common dev branch. (There won't be any conflicts because they have been resolved in the previous merge.)

Tip: when merging from common dev branch into yours it is easier to accept all remote changes and only then carefully pick and apply your own changes.

André
  • 1,602
  • 2
  • 12
  • 26