Using xcode, how can I diff between a working copy of a file and the latest commit in the respository? Using xcode, how can I diff between a working copy of a file and the latest commit in the respository? xcode xcode

Using xcode, how can I diff between a working copy of a file and the latest commit in the respository?


Here are screenshots.

Click the Version Editor button in the top-right (highlighted box):

enter image description here

Then, click the revision to compare with (footer highlighted box):

enter image description here


Also, you can navigate through each change using these buttons: < and >

enter image description here


Finally, you can undo a single change with "Discard Change" like so:

enter image description here


It's not exactly diff but you can get a side-by-side comparison using the version editor button, just above the word "Editor" at the top-right of your Xcode window.

It's the arrow icon to the right of the Assistant Editor icon on upper right of screen 1. The commit/cancel answer also works. Menu: source_control --> Commit (then cancel).


Phillip and Donn both have the correct answer but I'm including an additional screenshot to clarify why using the "Show the Version editor" button is the PRECISELY CORRECT ANSWER TO THIS QUESTION. I'd argue that this should be the accepted answer and all others should be deleted to avoid confusion. :)

As shown in the screenshow below, "Show the Version editor" presents a split view that is a VISUAL DIFF between selected revisions, which default to your local revision on the left and the most recent repo revision on the right. The key is to use the arrows centered at the bottom to browse through the individual diffs. The numbers between the arrows indicate the current diff and the total number of diffs.

Version Editor View