如何使用XCode的mergetool来解决冲突?

问题描述 投票:0回答:2

我正处于一个rebase的中间,我需要修复一些合并冲突。当我在XCode中打开文件时,我在文件中看到源控件冲突标记(<<<<<<<等)。

如何使用XCode的mergetool以图形方式解决这些冲突?我正在寻找这个屏幕:

enter image description here

xcode merge xcode10 merge-conflict-resolution git-merge-conflict
2个回答
1
投票

FileMerge工具是一个单独的应用程序,您可以从Xcode菜单打开它:

enter image description here


1
投票

here得到答案

# Tell system when Xcode utilities live:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

# Set "opendiff" as the default mergetool globally:
git config --global merge.tool opendiff

然后,当git告诉你存在冲突时,你可以运行git mergetool并打开XCode的mergetool(就像在问题的截图中一样),你可以解决冲突。

© www.soinside.com 2019 - 2024. All rights reserved.