Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Using xcode I would like to see a diff between a working copy of a file and the latest commit in the respository. I know that if I commit I can get the comparison. And I know I do it from the command line using 'git diff'. But is there a way to do it from the xcode GUI?

I keep thinking there must be a way to do this, but can't find it.

like image 636
lp1756 Avatar asked May 19 '12 15:05

lp1756


People also ask

How do I see commit history in Xcode?

To compare changes in one source file, open the file and click the Enable Code Review button in the upper-right corner of the Xcode window. The comparison view highlights changes between the current source code and the most recent commit.

How can I see my git history in Xcode?

Click and hold on the Version Editor button and select Log. You can also choose View\Version Editor\Show Log View from the menu. Xcode will list the commits that contain changes to the current file.


1 Answers

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

like image 192
Donn Lee Avatar answered Sep 28 '22 04:09

Donn Lee