How to View Git History, Blame, and the Source Control Graph in VS Code

Explore your Git history in VS Code with the Source Control Graph, Git blame annotations, and the Timeline view. See who changed what, when, and why.

6 min read

Understanding who changed what and why is a core part of working with Git. VS Code provides three built-in tools for exploring your repository history: the Source Control Graph, Git blame annotations, and the Timeline view.

If you are new to Git in VS Code, start with /vscode/how-to-stage-commit-push-and-pull-changes-in-vs-code to learn the basic commit workflow before diving into history exploration.

Source Control Graph

The Source Control Graph is a visual representation of your commit history and branch structure. Open it by selecting the graph icon in the Source Control view toolbar.

The graph shows:

  • Your current branch highlighted
  • The upstream branch and its commits
  • Incoming commits (↓) from the remote that you can pull
  • Outgoing commits (↑) that you have not pushed yet
  • Other local and remote branches in relation to the current branch

Select any commit in the graph to see which files were changed in that commit. Select a file to open its diff. Right-click a commit to access actions like Checkout, Cherry-Pick, Compare with, Revert, or Add Commit to Chat (for Copilot context).

The graph toolbar lets you fetch, pull, push, and sync directly.

Git blame

Git blame shows you who last modified each line of a file, in which commit, and when. VS Code shows blame information in two places.

Editor decoration: Enable with the Git: Toggle Git Blame Editor Decoration command from the Command Palette. A faded annotation appears at the end of each line showing the author and commit date. Hover over it to see the full commit message, author details, and relative time.

Status Bar item: Enable with the Git: Toggle Git Blame Status Bar Item command. When your cursor is on a line, the Status Bar shows the author and commit summary. Select it to see the full commit details.

You can customize the blame message format with the git.blame.editorDecoration.template and git.blame.statusBarItem.template settings. For example, to show the commit subject and author:

jsonjson
{
  "git.blame.editorDecoration.template": "${subject}, ${authorName} (${authorDateAgo})"
}

If you use AI co-author attribution (the git.addAICoAuthor setting), the blame tooltip also shows when AI contributed to a commit.

Timeline view

The Timeline view shows the history for a specific file. Open it at the bottom of the File Explorer panel. With a file open in the editor, the Timeline lists:

  • Git commits that touched that file, with author and message
  • Local file saves (if enabled)

Select any entry to see the diff at that point in time. Use the filter to show only Git commits or include local history.

The Timeline view is useful when you want to trace how a single file evolved over time, or find when a particular change was introduced.

Compare commits and branches

You can compare any two points in your history directly from the Source Control Graph. Right-click a commit and select Compare with, then choose another commit, branch, or tag. VS Code opens a diff view showing all files that differ between the two points.

This is helpful when you want to see what changed between two releases, or understand the cumulative diff of a feature branch before merging.

Once you understand your repository's history, learn how to /vscode/how-to-review-pull-requests-and-github-issues-in-vs-code to collaborate with your team.

Rune AI

Rune AI

Key Insights

  • Open the Source Control Graph from the Source Control view toolbar to see your commit history visually.
  • Enable Git blame with Git: Toggle Git Blame Editor Decoration to see line-by-line author info.
  • Hover over the Status Bar blame item to see the full commit message for the current line.
  • Use the Timeline view in the Explorer to see the commit history for a specific file.
  • Right-click commits in the graph to checkout, cherry-pick, compare, or add context to chat.
RunePowered by Rune AI

Frequently Asked Questions

How do I see who last changed a specific line of code?

Enable Git blame with the **Git: Toggle Git Blame Editor Decoration** command. Hover over any line to see the commit message, author, and date. You can also enable the Status Bar blame item to see blame info for the line your cursor is on.

Can I see the history of a single file?

Yes. Open the Timeline view at the bottom of the File Explorer. With a file open, the Timeline shows every commit that touched that file, plus local save history.

How do I compare two commits in the Source Control Graph?

Right-click a commit in the graph and select **Compare with**, **Compare with Remote**, or **Compare with Merge Base**. Choose another commit, branch, or tag to compare against.

What do the up and down arrows mean in the Source Control Graph?

Up arrows (↑) show commits you have locally that are not yet pushed. Down arrows (↓) show commits on the remote that you have not pulled yet. The number next to each arrow tells you how many commits are pending.

Conclusion

VS Code gives you three tools to understand your Git history: the Source Control Graph for branch-level history, Git blame for line-level attribution, and the Timeline view for per-file history. Together they let you answer who changed what, when, and why without leaving the editor.