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.
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.
option
+cmd
+2
–
Souza 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.
shift+command+alt+Enter
. command+enter
to go back to standard editor. –
Groundhog 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 .
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
- Enable Code Review (default:
cmd+shift+opt+Enter
to toggle) - On the right of the bottom bar (or if you have the debug area opened: the bar that sits on top of it) 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
Comparison buttons on Debug Area
To show a side by side view of the current file and its changes over time press Shift
Command
Return
.
When you're done, press Command
Enter
to return to the normal text editor.
Works in Xcode 14.
© 2022 - 2024 — McMap. All rights reserved.