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:
{
"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
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.
Frequently Asked Questions
How do I see who last changed a specific line of code?
Can I see the history of a single file?
How do I compare two commits in the Source Control Graph?
What do the up and down arrows mean in the Source Control Graph?
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.
More in this topic
How to Use VS Code with WSL 2 on Windows
Run VS Code connected to Windows Subsystem for Linux so you can develop in a full Linux environment with native tools, terminals, and debugging, all from Windows.
20 Best VS Code Extensions for Web Developers in 2026
Twenty carefully chosen VS Code extensions every web developer should know. Covers formatting, linting, frameworks, debugging, Git, and developer experience.
How to Install, Disable, Update, and Uninstall VS Code Extensions
Learn how to install, disable, update, and uninstall VS Code extensions from the Marketplace and the command line. Step-by-step instructions for every action.