File history and blame
History lists every commit that changed a file, following renames, like git log --follow. Blame shows, for each line, the commit and author that last changed it, like git blame. Both are views of the file workspace.
Works in GitTree Free: every local Git feature, once you are signed in.
On this page
Before you start
- The file is committed: blame shows committed versions, not unsaved edits in your working folder.
Where to find it
- Open a file from the Files section of the left panel, or from a commit, then switch its view to History or Blame.
- Right-click a file in the changes panel: File History or File Blame.
- Right-click a file in the file browser: Show File History.
| Action | macOS | Windows and Linux |
|---|---|---|
| The command palette, then Blame File or Show File History | ⌘⇧P | Ctrl+Shift+P |
Steps
Open the file
Find it in the Files section of the left panel and select it (browse project files). The file opens in the middle.
See its history
Switch the view to History. Commits that changed this file lists them newest first, with renamed from … where the file had another name. Select one to see the change it made.
Blame the lines
Switch the view to Blame. Each line is marked with the commit that last changed it. Select a line: the bar above names that commit, its author and date.
Go further back
With a line selected, choose Blame Before This Commit in that bar to see who wrote it before that change; Back to the Later Blame returns.
Expected result
You know which commit introduced a line, who wrote it and why, from its commit message.
Blame options
- Ignore whitespace changes: a reindented line keeps the author who wrote its content.
- Follow moved lines: lines moved or copied from elsewhere keep their original commit.
If something goes wrong
“Blame shows committed revisions; commit or open a commit’s file.”
The file has changes that are not committed. Blame the committed version from a commit, or commit first.
“Git has no history for an untracked file.”
The file was never committed. Stage and commit it first.
Questions
Can I blame an older version of a file?
Yes. Open the file from an older commit in the graph and switch to Blame, or use Blame Before This Commit to walk back one change at a time.