Git File History Viewer

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.
Why This Exists
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.
Features
- adds
Show Git History to Explorer file context menus
- adds
Show Git History to editor context menus
- adds
Show Git History to 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
How It Works
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^ and commit
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.
Usage
- 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
Enter on 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 Diff to open the file diff for that commit.
- Use Back to return to the commit list.
Settings
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
Local Development
Run In Extension Host
- Install dependencies:
npm install
- Build the extension:
npm run build
- Press
F5 in VS Code.
- In the Extension Development Host window, open any Git repository and test the command on a tracked file.
Watch Mode
npm run watch
Then reload the Extension Development Host window after changes.
Testing
Run unit tests:
npm test
Build the extension:
npm run build
Packaging
Build a local VSIX:
npm run package:vsix
This produces a versioned file like:
vscode-file-log-0.0.1.vsix
You can install it in VS Code with Extensions: Install from VSIX....
Screenshots
Open From The Explorer

Open From The Editor

Command Entry

Commit List

Commit Details

File Diff In Selected Commit

Releases
Releases are created manually from the GitHub Actions UI.
The workflow:
- lets you choose the version bump type:
patch, minor, or major
- bumps the version in
package.json and package-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_PAT is configured
- creates a GitHub Release and uploads the VSIX asset
To run it:
- open the repository on GitHub
- go to
Actions
- select the
Release VSIX workflow
- click
Run workflow
- choose
patch, minor, or major
- start the run on your default branch
The result is a versioned release artifact that is ready to install or share.
Tech Stack
- TypeScript
- VS Code Extension API
- Vitest
@vscode/vsce
Limitations
- 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
License
MIT