Blame and file history

One sheet answers two questions about a file: who last changed each line, and which commits changed the file at all. Open it from any diff header, switch between Blame and History at the top, and jump from either into the History tab.

Where to find it

  • Changes tab › diff header: Blame and History, for any tracked file with changes.
  • History tab › inspector › diff header: Blame ("Who last changed each line, as of this commit") and History, for a file in the selected commit.
  • Command palette › Files: Blame path and History of path, for changed files and for the files in the selected commit.

Untracked and newly added files have no history, so the buttons aren't offered for them.

The sheet

The sheet shows the file's path and a segmented control, View: Blame or History. Press esc or the close button to dismiss it.

Blame

While loading it reads "Reading who changed each line…". Then each run of lines that came from the same commit is grouped, with the commit's short hash, author and relative time on a button, and the commit summary on a second line. Hovering shows the summary, the author's name and email and the full date. Clicking the button closes the sheet and selects that commit in History.

Runs are shaded by age in the accent colour: the newest changes are strongest, old lines fade towards the background, so the most recently touched parts of a file stand out.

Blame is taken as of the commit you opened it from: on Changes that is the working tree; from the inspector it is the selected commit, so lines changed later don't appear.

Files longer than 5000 lines are cut: "This file is long, so only its first 5000 lines are shown."

History

While loading it reads "Reading the file's history…". Then up to 500 commits that changed the file are listed, newest first, with the kind of change each made. Renames are followed, and a commit from before a rename shows the file's old path. If no commit has touched the file yet: "No commit has changed path yet."

Select a commit to see the diff it made to this file below the list. Two buttons sit above the diff:

ButtonWhat it does
Blame this versionSwitches to Blame as of that commit.
Show in HistoryCloses the sheet and selects the commit on the History tab.

Free and Pro

Blame and file history work the same on Free and Pro.