Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsJul 6, 2026·3 min de lecture

GitLens — Supercharge Git in Visual Studio Code

A VS Code extension that adds inline Git blame, rich commit history, visual file comparisons, interactive rebase, and deep repository exploration to the editor.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
GitLens
Commande d'installation directe
npx -y tokrepo@latest install bab31084-7937-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

GitLens is a VS Code extension that enhances the built-in Git capabilities with inline blame annotations, rich commit details, visual file history, and powerful repository navigation. It surfaces the context behind every line of code directly in the editor without leaving your workflow.

What GitLens Does

  • Shows inline blame annotations on the current line with author, date, and commit message
  • Provides a sidebar view with file history, branch comparisons, and contributor details
  • Enables visual file and line diffs between any commits, branches, or tags
  • Offers an interactive rebase editor for reordering, squashing, and editing commits
  • Includes a commit graph for visualizing branch topology and merge history

Architecture Overview

GitLens runs as a VS Code extension that interfaces with the local Git binary through the VS Code Git API and direct process spawning. It decorates editors with blame data fetched from git log and git blame commands, caches results for performance, and renders them through VS Code's decoration and webview APIs. The commit graph and history views use webview panels with custom rendering.

Self-Hosting & Configuration

  • Install from the VS Code Marketplace or download the VSIX for offline installation
  • Core features (blame, history, diff) work with no configuration on any Git repository
  • Customize which annotations appear via Settings -> GitLens -> Current Line Blame
  • Configure code lens settings to show recent changes and authors above functions
  • Advanced features like the visual commit graph are available in the free tier

Key Features

  • Current line blame shows who changed each line and when, inline as you navigate
  • File annotations toggle between blame, changes, and heatmap views for the entire file
  • Revision navigation lets you step through a file's history version by version
  • Worktrees view manages multiple Git worktrees from the sidebar
  • Deep linking generates shareable URLs to specific lines at specific commits

Comparison with Similar Tools

  • Git Blame (built-in) — VS Code's native blame is basic; GitLens adds rich context and navigation
  • Git History — extension focused on log viewing; GitLens covers blame, history, and more
  • GitHub Pull Requests — extension for PR review; GitLens focuses on local repository context
  • tig — terminal-based Git browser; GitLens integrates the same insights into the VS Code UI
  • Magit (Emacs) — powerful Git porcelain for Emacs; GitLens is the VS Code equivalent in scope

FAQ

Q: Is GitLens free? A: Yes. Core features including blame, history, diffs, and the commit graph are free for all repositories. Some advanced features require a Pro subscription for private repos.

Q: Does GitLens slow down VS Code? A: GitLens is designed to be lightweight. Blame data is fetched lazily and cached. If you experience slowness on very large repos, disable code lens or reduce annotation frequency.

Q: Can I use GitLens with GitHub, GitLab, or Bitbucket? A: Yes. GitLens integrates with remote hosting services for deep linking, avatar fetching, and issue references.

Q: How do I disable inline blame temporarily? A: Toggle it with the command palette: GitLens: Toggle Line Blame, or use the status bar indicator.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires