3

Apple's Version Editor help has only two subjects, "Comparing Versions of a File with the Timeline" and "Comparing Versions of a File with the Jump Bars" neither of which describes a way to back out or add particular changes to the current version of a file, or create a merge file from the pair being compared.

I can't find any controls, menu items, or context menu items that seem to be useful. The context item "Copy Source Changes" seemed promising, but what it does is fill the paste buffer with the diff script for the selected change. Pasting it into the other file does nothing useful, you simply end up with the diff script embedded in the file.

Lots of us found Apple's Filemerge to be kind of weird and counterintuitive, but at least it had a mechanism for choosing which changes to accept or decline in a final file.

And of course P4's merge tool is outlandishly sluggish and weird, but it too provided a merge mechanism.

Perhaps the question I should ask is "Is there a good way to do revision merges in an Xcode/Git workflow?"

1
  • And it looks like my last question was the right one, and the answer is: Not yet, a lot of the more useful and interesting Git tasks must be done outside of xCode (so far), including partial staging, committing or de-committing changes in file versions, stashing, and reverting to arbitrary file versions.
    – Taryn
    Mar 17, 2012 at 20:53

1 Answer 1

1

To get Choose Right and Choose Left functionality in Xcode, you have to perform the merge. Choose File > Source Control > Merge. When you do the merge a sheet opens that has both versions of the file. There is a switch next to each difference where you can choose the version to use.

If you want to back out of changes you made to a file, select the file in the project navigator, right-click, and choose Source Control > Discard Changes.

3
  • 1
    That certainly seemed promising, but perhaps it only applies to branch merges? When I view a file in the editor or Version Editor pane which i know has several versions (all committed), selecting File:Source Control:Merge displays an error dialog "The working copy "tarynv_iOS_Main" has uncommitted changes. Try committing or discarding the changes." But in fact, there are no uncommitted changes, and subsequently there are no changes to discard or commit.
    – Taryn
    Mar 15, 2012 at 18:38
  • I feel like I might be missing something elemental here; all i really want is a way to merge forward or back through a sequence of changes to single files. I could simply feed the files to FileMerge, which is still available standalone in the XCode4 app bundle, but Git hides the old versions so well that it becomes tedious to root them out as loose files.
    – Taryn
    Mar 15, 2012 at 18:45
  • 1
    You're going to have use something besides Xcode to merge through a sequence of changes to a file. Mar 15, 2012 at 22:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.