Use GitLens to Explore your Git History in VS Code

GitLens is a fantastic VS Code extension that allows you to explore and navigate your Git history with pinpoint precision.

GitLens works by embedding all types of useful information directly in your code (only in development). For example, you can see who, when, what, and why other developers have made changes to any file in your project.

Screenshot of Gitlens showing git history on a code line in VS Code
GitLens shows the commit message of any line of code in your project.

Install GitLens

To install GitLens, go to the Extensions Marketplace inside Visual Studio Code and search for “GitLens”, and click install.

You can use this keyboard shortcut to open the Extensions tab in VS Code:

  • Cmd + Shift + X on Mac
  • Ctrl + Shift + X on Windows

GitLens works as soon as you have installed it. No setup is required.

After installing GitLens, you‘ll notice there’s an extra tab on the left sidebar in VS Code. Inside this tab, you can easily explore and navigate your Git history:

VS Code new tab after installing GitLens
Click on the new GitLens tab to start exploring your Git history.

GitLens especially useful if you’re working in a team, but it’s also helpful to see what a developer did and why, for example, if you’re working with a boilerplate repository.


Has this been helpful to you?

You can support my work by sharing this article with others, or perhaps buy me a cup of coffee 😊

Kofi

Share & Discuss on