Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Git history for selectionNew to Visual Studio Code? Get it now.
Git history for selection

Git history for selection

vitalivu992

|
48 installs
| (0) | Free
View git history for files and line selections with diff viewer
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Git History for VS Code

A powerful VS Code extension that provides git history visualization inspired by IntelliJ's Git History. View file history, selection history, and explore diffs with an intuitive split layout: the commit list and changed-files detail live in the Git History bottom-panel tab (beside Terminal), and selecting a commit opens its diff in a reusable editor-area tab. The diff tab opens side by side when each side fits at least 120 characters per line, otherwise unified; an icon button toggles the view, and word wrap keeps both sides line-aligned.

Highlights

  • Four ways in: file history, selection (line-range) history, repository history, and Explorer file/folder history
  • Split layout: commit list in the bottom panel, diff in a reusable editor tab that never steals focus
  • Search that knows git: author:, tag:, branch:, path:, message:, body:, after:, before:, last:2weeks, regex mode, and search inside diffs (git log -G)
  • Compare anything: Shift+click two commits for a range diff, Ctrl+click for a combined diff, or compare with the parent
  • Inline blame trailing the code at a fixed column, with a hover that opens the commit
  • Git actions from the list: cherry-pick, revert, reset, create branch/tag, delete tag, switch branch, restore a file
  • Permalinks for commits and files on GitHub, GitLab, Bitbucket, and Azure DevOps
  • Keyboard first: about 35 shortcuts, press ? in the panel for the full list

File History

File History

Selection History

Selection History

Repository History

The full branch log (Command Palette → "Git History (Repository)"), loaded in pages of gitHistory.maxCommits commits. Right-click a folder in the Explorer → Git History for the same view scoped to that folder.

Repository History

Diff Views

Side by side with word wrap: a wrapped line takes the same height on both sides, so line N stays level.

Side-by-side diff with word wrap

Unified (narrow tabs, or gitHistory.defaultDiffView: unified):

Unified diff

Documentation

Topic Where
Features (catalog + dev impl map + backlog) FEATURES.md
Technical architecture (layout, protocols, build) ARCHITECTURE.md
Usage, context menus & keyboard shortcuts USAGE.md
Settings & persisted preferences CONFIGURATION.md
Version history CHANGELOG.md

Installation

  • VS Code Marketplace: vitalivu992.git-history-vsce, or run code --install-extension vitalivu992.git-history-vsce
  • Open VSX (VSCodium, Cursor, Windsurf, Gitpod): vitalivu992/git-history-vsce
  • From inside the editor: open the Extensions view (Ctrl+Shift+X / Cmd+Shift+X), search for "Git history for selection", and click Install
  • From a .vsix: build with make package, then run "Extensions: Install from VSIX..." from the Command Palette

Then open any file in a git repository and press Ctrl+Alt+H / Cmd+Alt+H.

Requirements

  • Visual Studio Code 1.85.0 or higher
  • Git installed and available in your PATH
  • A git repository

Settings

Setting Default Description
gitHistory.hideMergeCommits false Hide merge commits from the commit list (No Merge button)
gitHistory.defaultDiffView auto Diff view when the diff tab opens: auto (side by side when each side fits 120 characters per line, otherwise unified), unified, or side-by-side. The toolbar icon button switches the view for the open tab
gitHistory.diffContextLines 5 Number of unchanged context lines shown around each change in diffs (1–10)
gitHistory.maxCommits 500 Number of commits loaded per page (initial load and each "Load more")
gitHistory.blame.dateFormat short Date format shown after the author in blame annotations: relative, short, or iso
gitHistory.blame.annotationOffset 160 Character column where trailing blame annotations start; lines longer than the column hide the annotation so it never covers the code
gitHistory.commitList.dateFormat relative Date format for the commit list: relative, short, or iso

Keyboard Shortcuts

Global (work from any text editor)

Keybinding Action
Ctrl+Alt+H / Cmd+Alt+H Git History (File)
Ctrl+Alt+Shift+H / Cmd+Alt+Shift+H Git History for Selection
Alt+B / Option+B Toggle Blame Annotations

Navigation

Keybinding Action
↑ / ↓ Navigate up/down through commits
Home / End Jump to first / last commit
PageDown / PageUp Jump down / up one page (10 commits)
Enter Select focused commit and show its diff
Shift+Enter Select range from anchor to focused commit
Ctrl+Enter / Cmd+Enter Add/remove from multi-selection
Ctrl+A / Cmd+A Select all visible commits
Ctrl+L / Cmd+L Focus commit list
/ or Ctrl+F / Cmd+F Focus search input
Ctrl+G / Cmd+G Jump to commit by hash
Alt+P / Option+P Jump to Parent commit
Ctrl+Alt+P / Cmd+Alt+P Quick compare with parent commit
Ctrl+] / Cmd+] Tag Navigation — jump to next tagged commit
Ctrl+[ / Cmd+[ Tag Navigation — jump to previous tagged commit
? Show Keyboard Help dialog
Escape Clear selection and close dialogs

Search & Filter

Keybinding Action
Alt+R / Option+R Toggle regex search mode
Ctrl+Alt+M / Cmd+Alt+M Toggle "Show my commits only" filter
Ctrl+Shift+Q / Cmd+Shift+Q Toggle hide merge commits
Ctrl+Alt+Q / Cmd+Alt+Q Clear all filters

View Options

Keybinding Action
Alt+Z / Option+Z Toggle word wrap (while the diff tab is focused)
Ctrl+Shift+Alt+J / Cmd+Shift+Alt+J Toggle ignore whitespace (while the diff tab is focused)
Ctrl+Shift+3 / Cmd+Shift+3 Toggle sort order (Newest/Oldest)

Copy Commands

Keybinding Action
Ctrl+Alt+C / Cmd+Alt+C Copy commit hash
Ctrl+Shift+7 / Cmd+Shift+7 Copy short hash
Ctrl+Shift+I / Cmd+Shift+I Copy commit info
Ctrl+Shift+Alt+R / Cmd+Shift+Alt+R Copy range diff (between two selected commits)
Ctrl+Shift+L / Cmd+Shift+L Copy commit URL
Ctrl+Shift+Alt+L / Cmd+Shift+Alt+L Open commit URL in browser

Actions

Keybinding Action
F5 Refresh history
Ctrl+Shift+R / Cmd+Shift+R Refresh history (alternative)
Ctrl+Alt+K / Cmd+Alt+K Cherry-pick commit
Ctrl+Alt+R / Cmd+Alt+R Revert commit
Ctrl+Alt+S / Cmd+Alt+S Switch (checkout) branch — searchable picker of local/remote branches; also right-click the branch badge
Ctrl+Shift+Alt+B / Cmd+Shift+Alt+B Create branch
Ctrl+Alt+I / Cmd+Alt+I Create tag
Ctrl+Alt+. / Cmd+Alt+. Delete tag

Context Menus

Right-click on commits in the commit list or files in the changed files list to access additional options.

Commit Row Context Menu:

Action Description
Copy commit hash Copy the full commit hash to clipboard
Copy commit info Copy full commit information (hash, author, date, message)
Copy commit URL Copy the web URL (GitHub/GitLab/Bitbucket/Azure DevOps) for the commit
Open commit URL in browser Open the commit page on the git hosting platform in the default browser
Copy short hash Copy the 7-character short hash
Create branch from commit Create a new branch at the selected commit
Create tag from commit Create a git tag at the selected commit
Delete tag from commit Delete a git tag from the selected commit
Cherry-pick commit Cherry-pick this commit onto the current branch
Revert commit Revert this commit
Reset to this commit Reset the current branch to this commit (soft/mixed/hard)

Changed Files Context Menu:

Action Description
Open file at this commit View the file content as it was at the selected commit
View diff for this file Show the diff for this specific file only
Compare with working tree Diff the file between this commit and your current working tree
Blame file Open the file with blame annotations turned on
Open file URL at this commit Open the file's permalink on your git hosting platform at this commit (GitHub/GitLab/Bitbucket/Azure DevOps)
Copy file URL at this commit Copy the file's permalink (GitHub/GitLab/Bitbucket/Azure DevOps) to the clipboard
Restore file from this commit Restore the file version from this commit into the working tree (git checkout <hash> -- <file>)
Copy path Copy the absolute file path
Copy relative path Copy the file path relative to the repo root
Reveal in File Explorer Open the file in the system file explorer

License

MIT

Issues

Report issues at: https://github.com/vitalivu992/vscode-git-history/issues

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft