XCode source control: view changes for one file

39,124

Solution 1

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

Solution 2

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

enter image description here

Solution 3

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.

Solution 4

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.

Share:
39,124
dariaa
Author by

dariaa

#SOreadytohelp

Updated on July 09, 2022

Comments

  • dariaa
    dariaa almost 2 years

    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.

  • Oren
    Oren about 9 years
    This shows the history of each line of code. Is there a way to view the history of a file by date instead? For example, for a single file view all the dates it was changed on. And then for one of those dates, view the changes made via a compare.
  • Aleksei Minaev
    Aleksei Minaev over 7 years
    Xcode 8+. Comparison "time machine" gone for me. Do you have the same?
  • Adam Carter
    Adam Carter over 7 years
    @zulkis Missing for me too :(
  • André Morujão
    André Morujão about 7 years
    That's the Log view in the image above. You don't get to see the diff between the current version and any version, but rather the diffs from one version to the next.
  • Seto
    Seto over 6 years
    For shortcut shift+command+alt+Enter. command+enter to go back to standard editor.
  • Troy Harvey
    Troy Harvey over 6 years
    That was the best part. You could scroll through time and see when someone touches that spot.
  • Motti Shneor
    Motti Shneor over 5 years
    @AlekseiMinaev I can't remember now about Xcode 8 - but in Xcode 9.x and 10.x. the "Time-Machine" like UI was replaced by another view - instead of "Comparison" view, choose the "Log View" which presents the source, with a side-bar on the right, presenting all the commits to the file with their comment, date, author and hash. The "Authors View" will present the author (and his commit's details) for every line in the source. So you can clearly see who wrote what, and when. I find these three views very useful, But my hears still longs for the time-machine style UI. It was beautiful
  • Aleksei Minaev
    Aleksei Minaev over 5 years
    @MottiShneor Yes, I saw that. It is cool, but it is not really helpful to check diff for one specific file.