Git Metrics for VS Code
Git Metrics shows author-level Git activity for the active VS Code workspace. It is the VS Code port of the IntelliJ Platform version and keeps the same statistics behavior:
- Fast Summary mode: authors, lines added, lines deleted, and modified files, sorted by added lines.
- Detailed mode: Fast Summary columns plus commit counts, sorted by commits by default.
- Toolbar filtering by date range, branch scope, user, and workspace-relative paths.
- Date range filtering with This Week, Last 7 Days, This Month, custom ranges, or all history.
- Newline-delimited excluded paths relative to the workspace root in settings.
- Copy selected rows, copy visible rows, and export visible rows to CSV.
Requirements
- VS Code 1.120 or newer.
- Git available on
PATH, or set gitMetrics.gitPath to the Git executable path.
- Open a folder inside a Git work tree before refreshing the view.
Usage
- Open the Git Metrics view from the Activity Bar.
- Use the Date, Branch, User, and Paths toolbar chips to focus the report.
- Date input accepts
yyyy-MM-dd - yyyy-MM-dd, yyyy-MM-dd ~ yyyy-MM-dd, yyyy-MM-dd to yyyy-MM-dd, and yyyy-MM-dd 至 yyyy-MM-dd; clear it to report across all history.
- Use Settings to pick
Fast Summary or Detailed, and to add excluded paths one path per line.
- Click
Refresh.
The Paths chip temporarily includes selected project-relative files or folders in the current report. Excluded paths in settings still remove noisy files from every calculation.
Rows can be sorted by clicking table headers. Click rows to select them, use multi-select with Cmd/Ctrl-click, and use Shift-click for ranges.
Settings
| Setting |
Default |
Description |
gitMetrics.mode |
fast_summary |
Default mode for the Git Metrics view. |
gitMetrics.exclude |
empty |
Newline-delimited paths to exclude. Backslashes are normalized to slashes. |
gitMetrics.gitPath |
git |
Git executable path. |
gitMetrics.defaultMode |
Top-speed |
Deprecated legacy setting from the old VS Code version. |
Development
pnpm install
pnpm check
pnpm compile
Open this folder in VS Code and press F5 to launch the Extension Development Host. The launch configuration runs pnpm: compile before startup.
Useful commands:
pnpm clean
pnpm check
pnpm dev
pnpm package
Packaging and Publishing
The extension uses the official @vscode/vsce tool. See the VS Code publishing guide for Marketplace account and PAT setup: https://code.visualstudio.com/api/working-with-extensions/publishing-extension.
pnpm install
pnpm check
pnpm package
Before publishing:
- Confirm
publisher in package.json matches your Marketplace publisher ID.
- Create an Azure DevOps Personal Access Token with Marketplace
Manage scope.
- Run
pnpm --filter git-metrics exec vsce login <publisher-id> and paste the PAT.
- Run
pnpm publish.
You can also upload the generated git-metrics-<version>.vsix manually from the Visual Studio Marketplace publisher management page.