How to compare branches in xcode

Viewed 8475

I am using xcode and its source controler. I would like to compare two branches I made. Impossible to do so by using the comparison mode. When I do it, it splits the editor in two (that is right) but I cannot put on branches on one side and the other one on the other side.

Any help?

All the best

5 Answers

In Xcode 12 you choose View->Show Code Review. You'll have two windows, one with the most current edits ("Local Revision") and the other lets you choose from various prior commits.

Assuming you already pulled both branches and now you're watching a feature branch, run

git reset develop

where develop is the other branch to compare.

File inspector

After that all the modified files and folders are marked in the file inspector.

Next, you can simply use Xcode file comparision:

File comparision button

I don't think this is available yet (Xcode 11). The best you can do is compare individual commits or if you know which files were changed, you can compare individual file changes for those commits.

In XCode 11.x you have to press the two arrows, located on the top right.enter image description here

Related