Question

Is it possible to view a "timeline" (history) for a selected file for like 50 commits? I mean changes made to this particular file and and view commits when they were made and users who changed them? I know Xcode got some powerful version control features, I just can not find this one.

Was it helpful?

Solution

What it sounds like you want is the "Blame View", if we were on the terminal you could write git blame <file-name> to see the commit/time/and user for every single line of a particular file. In Xcode you can accomplish the same thing by activating the blame view. I've posted a picture to show you where the Blame View button resides. From there you should be all set.

Open Xcode Blame View

OTHER TIPS

For xcode 11.0, If you select a file, changes for that file is available on right panel.

enter image description here

The commit history is in the Version Editor.

Select the file for which you want to see the commit history. Then go to View > Version Editor > Show Version Editor (or just select the Comparison view from the top-right toolbar icon - same place as the Blame view).

Clicking on the commit label below the editor will reveal the history including dates.

Yes. Xcode's Comparison view is exactly for that. When you select a source file, and choose comparison view, you have a time-machine like user-interface that besides letting you compare any two versions of the file, will also present (when you hover) all the commits of the file with their descriptions. This UI opens when you click the clock button in the bottom between the two versions of the comparison view.

Pay attention, that Xcode will list all the commits, but will fail to show the content of versions of the file if the file-name or path changed. I think Xcode makers thought that because sources are considered "different" if they are named differently or located differently, there's no point in showing them. It may be, though that they just overlooked the --follow parameter to git.

Xcode 13

  1. Enable Code Review (default: cmd+shift+opt+Enter to toggle)
  2. Show the Debug Area (default: cmd+shift+Y to toggle)
  3. On the top-right of the debug area there are a couple of buttons used for comparing commits: clicking them allows you to pick which commits to use for the comparison on the current file.

Enable Code Review button

enable code review

Comparison buttons on Debug Area

code review comparison buttons

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top