为什么 git / SourceTree 要我编辑源中的冲突而不是合并目标中的冲突?

Why does git / SourceTree wants me to edit conflicts in the source rather than in the destination of a merge?

我们正在通过 SourceTree 使用 git。我正在将一个母版(之前由于一些修补程序而更新)合并到一个发布分支(几个月前从母版中分离出来)。

Source Tree 表示在从 master -->release 执行 Pull Request 时存在冲突,并建议我使用下面的命令(通过 atlassian-Stash-GUI)。

但是我不明白的是:我似乎是通过下面的命令在master中解决冲突并将它们推送到master中。我也最终从 NextRelease 中获得了更改,然后在 master 中,因为这个 Pull Request,我宁愿只在 NextRelease 中拥有它们。

我本以为我应该在 NextRelease 分支中通过这些命令结束并解决那里的冲突并保持我的 master 不变。

我是不是做错了什么?

git fetch origin release/NextRelease

git checkout master
git merge FETCH_HEAD

<now we should resolve the conflicts>

git commit
git push origin HEAD

这就是拉取请求的工作原理。您解决合并发生的源中的冲突。拉取请求最常用于代码审查。

作为替代方案,您可以只进行正常合并,冲突解决应该在源上进行。

git checkout release/NextRelease

git merge master

<Resolve conflicts. Make sure everything looks good>

git push origin release/NextRelease