18

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

user1885349
  • 372
  • 1
  • 2
  • 10

5 Answers5

17

Yes you can compare file wise, just go to that specific file where you want to see modified changes by other branch.

Click on version editor

Then you will see following bar in editor

enter image description here

on left side, select your own branch and on right side, select branch which has done modifications.

Then you can compare by commits, listed time wise just beside branch name.

Nitesh
  • 1,924
  • 21
  • 31
4

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.

lp1756
  • 846
  • 1
  • 9
  • 18
4

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

Vladimir Vlasov
  • 1,860
  • 3
  • 25
  • 38
  • This is actually the best you can do, I think. But keep in mind that you are on a branch now that you need to discard or repair. Using the per-file features of xcode is tedious because when you change files, the selected branches reset. If you make the changes uncommitted, then you can use the "show modified" feature in the left-hand file pane to see all the modified files. Hopefully Xcode will support this feature soon. There is a an "examine commit" feature which shows a list of modified files in one commit, but it won't show multiple commits at once. – Chris Quenelle Jan 19 '22 at 17:49
2

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.

NSRover
  • 932
  • 1
  • 12
  • 29
  • 1
    Also to see files that have changed you can open terminal, go to your project directory and run `git diff --name-only branch1 branch2` then manually look at each file in Xcode. But not ideal depending on you project. – tagy22 Jan 23 '20 at 16:04
0

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

ap147
  • 162
  • 7