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
?
This is the procedure I would recommend:
dev
to dev2
branch.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.