Git File History Viewer is a VS Code extension for inspecting the history of a single file without leaving the editor.
It adds a Show Git History action to file context menus, reads that file's commit history with git log, and opens a diff for the selected commit against its parent.
VS Code already has solid Git support, but checking the history of one specific file often takes more steps than it should.
This extension is built for the simple workflow:
- right-click a file
- open its commit history
- inspect commit details
- open the file diff for the chosen revision
The goal is to make file-level Git history feel immediate, focused, and lightweight.
- adds
Show Git Historyto Explorer file context menus - adds
Show Git Historyto editor context menus - adds
Show Git Historyto editor tab/title context menus - loads commit history for the selected file with Git
- shows commits in a searchable picker
- supports a two-step picker flow with a commit list and a commit details view
- opens diffs in a pinned tab instead of replacing the current preview tab
- includes picker display settings for date, time, and extra details
When you run Show Git History, the extension:
- resolves the selected file
- finds the repository root with
git rev-parse --show-toplevel - loads commit history for that file with
git log -- <file> - lets you inspect commits in a Quick Pick
- opens a diff between
commit^andcommit
That means the diff shows exactly what changed in that file in the selected commit. If the file was introduced in that commit, the left side opens as an empty document instead of a Git error message.
- Open a Git repository in VS Code.
- Right-click a tracked file in the Explorer, editor, or tab.
- Select
Show Git History. - In the first picker, press
Enteron a commit to open the diff immediately. - In the first picker, click the arrow button to inspect commit details first.
- In the details view, review author, date, hash, and message.
- Choose
Open Diffto open the file diff for that commit. - Use Back to return to the commit list.
This extension contributes the following settings:
fileGitHistory.showDate- show the commit date in the history picker
fileGitHistory.showTime- show the commit time in the history picker
fileGitHistory.showDetailsInPicker- show author, full hash, and a short summary in the commit list
- Install dependencies:
npm install- Build the extension:
npm run build- Press
F5in VS Code. - In the Extension Development Host window, open any Git repository and test the command on a tracked file.
npm run watchThen reload the Extension Development Host window after changes.
Run unit tests:
npm testBuild the extension:
npm run buildBuild a local VSIX:
npm run package:vsixThis produces a versioned file like:
vscode-file-log-0.0.1.vsix
You can install it in VS Code with Extensions: Install from VSIX....
Releases are created manually from the GitHub Actions UI.
The workflow:
- lets you choose the version bump type:
patch,minor, ormajor - bumps the version in
package.jsonandpackage-lock.json - commits the version bump back to the branch
- creates a git tag like
v0.1.0 - runs tests and build
- packages
vscode-file-log-0.1.0.vsix - publishes to the VS Code Marketplace if
VSCE_PATis configured - creates a GitHub Release and uploads the VSIX asset
To run it:
- open the repository on GitHub
- go to
Actions - select the
Release VSIXworkflow - click
Run workflow - choose
patch,minor, ormajor - start the run on your default branch
The result is a versioned release artifact that is ready to install or share.
- TypeScript
- VS Code Extension API
- Vitest
@vscode/vsce
- this extension depends on Git being available in the environment
- diffs are file-focused and compare the selected commit to its parent
- complex rename history cases are intentionally kept simple for now
MIT





