Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up file compare/diff in Xcode 4?

Tags:

xcode4

Am looking for how to set up file compare/diff in Xcode 4, but have run into brick wall. Anyone can tell me how to do it?

like image 366
pdenlinger Avatar asked May 16 '11 05:05

pdenlinger


People also ask

How can I compare two files for differences?

Right-click on the first file. Click on “Select for Compare” from the menu. Proceed to right-click on the second file. Click on “Compare with Selected.

How do I compare two commits in Xcode?

Yes you can compare file wise, just go to that specific file where you want to see modified changes by other branch. 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.

How do I compare two files on a Mac?

To start a comparison, click the File module and select your files from Finder. Meld will display them side-by-side. Any differences between them appear highlighted to make individual changes easier to see. On either side of the panels, you'll see two vertical bars with colored blocks.


2 Answers

If you're looking for comparing two different files (instead of comparing two versions of the same file), you can use the FileMerge tool included with Xcode. Spotlight can find it for you.

like image 63
zhengyue Avatar answered Sep 20 '22 06:09

zhengyue


Richard Brightwell's answer is correct, although it threw me a bit as there is a step missing.

  1. Select the file from project navigator then click the version editor button (top right).
  2. Click the timeline icon between the two files to display a vertical bar representing the revisions (black bar with white indicators for each revision).
  3. Drag the white arrows to the versions to compare.

XCode 4 Compare Utility

like image 35
Jason George Avatar answered Sep 19 '22 06:09

Jason George