How to use XCode's mergetool to resolve conflicts?

丶灬走出姿态 提交于 2019-12-22 11:26:54

问题


I'm in the middle of a rebase and I need to fix some merge conflicts. When I open the file in XCode, I see the source control conflict markers (<<<<<<<, etc) in the file.

How can I use XCode's mergetool to resolve these conflicts in a graphical fashion? I'm looking for this screen:


回答1:


Pulling the answer from 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

Then, when git tells you that there is a conflict, you can run git mergetool and it will open XCode's mergetool (like in the question's screenshot) and you can work through the conflict.




回答2:


The FileMerge tool is a separate application, which you can open from the Xcode menu:



来源:https://stackoverflow.com/questions/54889428/how-to-use-xcodes-mergetool-to-resolve-conflicts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!