GitLens is an open-source extension for Visual Studio Code created by Eric Amodio.

GitLens simply helps you better understand code. Quickly glimpse into whom, why, and when a line or code block was changed. Jump back through history to gain further insights as to how and why the code evolved. Effortlessly explore the history and evolution of a codebase. Dive right in and see how GitLens can help!

While GitLens is powerful and feature rich, it is also highly customizable to meet your specific needs — find code lens intrusive or the current line blame annotation distracting — no problem, it is quick and easy to turn them off or change how they behave via the built-in GitLens Settings editor, an interactive editor covering many of GitLens' powerful settings. While for more advanced customizations, refer to the GitLens docs and edit your User Settings.

Support GitLens ❤
Configure GitLens

Don't miss how easy it is to configure GitLens!

## What's New in GitLens 9

See the release notes for the full set of changes

Show What's New after upgrading to new feature releases

- 9.7 MAY 2019
- NEWAdds support for Live Share presence

  Adds an avatar presence indicator and an invite button to start a Live Share session with the code author to the Details hover

  Adds presence status and an Invite to Live Share command to contributor nodes in the Repositories view

- NEWAdds a new Views Side Bar Layout section to the interactive settings editor (via the GitLens: Open Settings command) with 3 layout presets

  Default — shows all the views together on the GitLens side bar

  Source Control — shows all the views together on the Source Control side bar

  Contextual — shows Repositories on the Source Control side bar, File and Line History on the Explorer side bar, and others on the GitLens side bar

- NEWImproves the accuracy and experience of the following:

  Details hover

  Changes (diff) hover

  Open Changes with Previous Revision command

  Open Line Changes with Previous Revision command — closes #719

  Open Changes with Working File command

  Open Line Changes with Working File command

  Open Changes with Next Revision command

- NEWAdds support to the Details and Changes (diff) hovers to differentiate between staged and unstaged changed
- NEWAdds a Show All command to the Show More nodes in the views
- NEWAdds Show More support (i.e. paging) to the File and Line History views
- NEWAdds an improved experience when starting a new commit search or comparision
- NEWAdds the renamed path to the description and tooltip of file nodes in the views
- NEWAdds a `gitlens.advanced.maxSearchItems` setting to specify the maximum number of items to show in a search — closes #728
- NEWAdds a `gitlens.defaultDateSource` setting to specify whether commit dates should use the authored or committed date — closes #537 thanks to PR #707 by Mathew King (@MathewKing)
- NEWAdds a `gitlens.advanced.similarityThreshold` setting to specify the amount (percent) of similarity a deleted and added file pair must have to be considered a rename — closes #670 thanks to PR #714 by x13machine (@x13machine)
- NEWAdds visual tracking to the table of contents of the interactive settings editor to make it easier to navigate and keep context
- NEWAdds new documentation on how to use and customize GitLens' formatting settings: View Docs
- NEWAdds an `${originalPath}` token for use with file formatting which provides the full file path of the original file, if renamed
- NEWAdds better logging to show current mode on startup and when changed — closes #725
- IMPROVEDChanges path collapsing to also collapse root paths when using the compact file layout in the views
- IMPROVEDEnsures file rename detection when getting the status of a repo or file
- IMPROVEDRemoves searching for commits by changed occurrences (`-S` flag) as it is too confusing and searching by changes (`-G` flag) better matches user expectations — closes #730
- FIXEDFixes #729 — "Show more results" in search commit show less results
- FIXEDFixes #716 — Browsing history of a renamed file fails in forward direction
- FIXEDFixes #724 — GitService.getBranches very very very long
- FIXEDFixes #625 — Branches in Repositories view shows some commit comment texts as branches
- FIXEDFixes issues with keyboard navigation (`alt+,` and `alt+.`) in commit details of the file history quick pick menu
- FIXEDFixes issues with keyboard navigation (`alt+,` and `alt+.`) in commit details of the branch history quick pick menu
- FIXEDFixes issues when showing all results in various lists and views
- FIXEDFixes issue with id collisions between branches, remotes, and tags in the Repositories view
- FIXEDFixes the Line History view when there are uncommitted and/or unsaved changes
- FIXEDFixes various issues when trying to find the working file from a commit
- FIXEDFixes issues where the Changes (diff) hover wouldn't work properly with renamed files
- FIXEDFixes an intermittent issue where hovers fail to show
- 9.6 APR 2019
- NEWAdds a new Contributors node to each repository in the Repositories view

  Lists the contributors in the repository, sorted by contributed commits. Provides the avatar (if enabled), name, and email address of each contributor

- NEWAdds a Collapse All command to the Repositories view — closes #688
- NEWAdds version links to the CHANGELOG — closes #617 thanks to PR #660 by John Gee (@shadowspawn)
- NEWAdds a `gitlens.views.pageItemLimit` setting to specify the number of items to show in a each page when paginating a view list. Use 0 to specify no limit
- NEWAdds a Checkout command to file nodes in the views to replace the local file with the specified revision — closes #684
- NEWAdds a prompt to enable the view to the Show * View commands when the specified view is disabled — closes #710, #711
- NEWAdds a `gitlens.hovers.changesDiff` setting to specify whether to show just the changes to the line or the set of related changes in the changes (diff) hover
- IMPROVEDRemoves the automatic suspension of the current line blame annotations while debugging — closes #382
- IMPROVEDRemoves the requirement of prefixing reference comparisons with `#` — closes #690
- IMPROVEDChanges related commit highlighting to only appear on cursor movement after file blame annotations are shown

  This is to improve performance and reduce initial visual overload

- IMPROVEDChanges Open Revision from... (`gitlens.openFileRevisionFrom`) command to allow entering references
- IMPROVEDImproves the behavior of the Show More Commits & Show More Results commands — no longer loses the context of the last selected item before showing more
- IMPROVEDImproves the maintaining of the line context when opening changes from the hovers
- IMPROVEDImproves the accuracy of the changes (diff) hover
- IMPROVEDImproves the rendering of the diff in the changes (diff) hover
- IMPROVEDImproves the behavior of the Open Changes with Next Revision (`gitlens.diffWithNext`) command when in the diff editor
- IMPROVEDImproves the behavior of the Open Changes with Previous Revision (`gitlens.diffWithPrevious`) command when in the diff editor
- IMPROVEDImproves the behavior of the Open Changes with Working File (`gitlens.diffWithWorking`) command when in the diff editor
- IMPROVEDRenames Compare HEAD with Branch or Tag... (`gitlens.diffHeadWithBranch`) command to Compare HEAD with... (`gitlens.diffHeadWith`)
- IMPROVEDRenames Compare Working Tree with Branch or Tag... (`gitlens.diffWorkingWithBranch`) command to Compare Working Tree with... (`gitlens.diffWorkingWith`)
- IMPROVEDRenames Open Changes with Branch or Tag... (`gitlens.diffWithBranch`) command to Open Changes with... (`gitlens.diffWithRef`)
- IMPROVEDRenames Open Revision from Branch or Tag... (`gitlens.openFileRevisionFromBranch`) command to Open Revision from... (`gitlens.openFileRevisionFrom`)
- IMPROVEDRenames Compare Branch or Tag with... (`gitlens.views.compare.selectForCompare`) command to Compare References...
- IMPROVEDRenames Choose from Branch or Tag History... quick pick item to Show File History from... for better clarity and to reflect that references are now allowed
- IMPROVEDChanges to use Day.js instead of date-fns for a reduced bundle size
- IMPROVEDRemoves `-m` flag from `git log` when following renames (`--follow`), because it returns all merge commits, whether the file was changed or not
- FIXEDFixes #683 — log.showSignature leads to stray files being displayed
- FIXEDFixes #691 — Auto-expand tree view on Swap Comparison
- FIXEDFixes #695 — Invalid URL in Open File in Remote when selecting origin/.. as comparison branch
- FIXEDFixes #701 — Contributors shows no commits for mailmapped committer name
- FIXEDFixes #697 — fixes git error handling for some linux OS'
- FIXEDFixes the behavior of the Open Line Changes with Previous Revision (`gitlens.diffLineWithPrevious`) command to follow the line history much better
- FIXEDFixes missing Compare References... (`gitlens.views.compare.selectForCompare`) from the command palette
- FIXEDFixes font issues in the Welcome to GitLens and GitLens Settings pages due to changes to the webview CSS font variables provided by VS Code
- FIXEDFixes issues with the Line History view sometimes showing a duplicate and out of order commit
- FIXEDFixes broken Open File command on the root node of the File History and Line History views
- FIXEDFixes broken Open Revision command on status files of the Repositories view
- FIXEDFixes the invite link to the VS Code Development Community Slack
- 9.5 FEB 2019
- NEWAdds a `mailto:` link to the author on the commit details hover — closes #642
- NEWAdds support for customizing the layout of the commit details hover

  Adds a `gitlens.hovers.detailsMarkdownFormat` setting to specify the format (in markdown) of the commit details hover

- NEWAdds the author's e-mail to the tooltip of commits in the views — closes #642
- NEWAdds a new author e-mail format token (`${email}`) — closes #642

  Supported in the following settings: `gitlens.blame.format`, `gitlens.currentLine.format`, `gitlens.hovers.detailsMarkdownFormat`, `gitlens.views.commitFormat`, `gitlens.views.commitDescriptionFormat`, `gitlens.views.stashFormat`, `gitlens.views.stashDescriptionFormat`, and `gitlens.statusBar.format`

- IMPROVEDChanges the sorting of remotes in the Repositories view to sort the default remote first
- IMPROVEDChanges relative date formatting of the last fetched date of repositories in the Repositories view to instead use an absolute format and will additionally add the time of day if less than a day has passed

  This avoids having to periodically refresh the repository (which causes all of its children to re-render) in order to update the relative time

- FIXEDFixes #591 — GitLens Error: Unable to opens
- FIXEDFixes #620 — Wrong URL to open commit on Azure DevOps if cloned via SSH — thanks to PR #621 by Yan Zhang (@Eskibear)
- FIXEDFixes #626 — Branch names with only digits always appear first — thanks to PR #627 by Marc Lasson (@mlasson)
- FIXEDFixes #631 — Remotes fail to show in gui
- FIXEDFixes #633 — Compare File with Previous Revision doesn't work if path contains '#'
- FIXEDFixes #635 — Show more commit not working properly
- FIXEDFixes an issue where the Open File, Open File on Remote, and Copy Remote Url to Clipboard commands didn't always work on changed files in the Repositories view
- FIXEDFixes an issue where the default remote wasn't used first to provide automatic issue linking
- 9.4 JAN 2019
- NEWAdds pinning of comparisons in the Compare view — pinned comparisons will persist across reloads
- NEWAdds an Open in Terminal command to repositories in the Repositories view
- FIXEDFixes #606 — ID for xxx is already registered?!
- FIXEDFixes #607 — Open file in Remote Doesn't URL encode
- FIXEDFixes #608 — Add an option to change the abbreviated commit SHA length — thanks to PR #611 by Skybbles // L5474 (@Luxray5474)
- FIXEDFixes #613 — Change Copy Remote URL to Clipboard to always copy a permalink (e.g. revision link)
- 9.3 JAN 2019
- NEWAdds favoriting of repositories and branches in the Repositories view to allow for better (user-customized) sorting
- NEWAdds the ability to specify a default remote selection when using the Open * in Remote commands — closes #504

  Adds Set as Default and Unset as Default commands to remotes in the Repositories view

- NEWAdds the ability to turn on file annotations (blame, heatmap, and recent changes) via user-defined modes — closes #542
- NEWAdds the ability to stage and unstage files by folders in the Repositories view — closes #599 thanks to PR #600 by Tony Brix (@UziTech)

  Adds Stage All Changes and Unstage All Changes commands to folders in the Repositories view

- 9.2 DEC 2018
- NEWImproves the commit search experience

  Remembers and restores the last commit search string. Adds a Search Commits command to the search results inline toolbar. Reopens the commit search when clicking on a search results without results

- NEWAdds a Collapse command to the toolbars of the Compare and Search Commits views — closes #383
- NEWAdds support for the new ability to have descriptions on view nodes — provides a much cleaner layout
- NEWAdds a `gitlens.views.repositories.compact` setting to specify whether to show the Repositories view in a compact display density — closes #571
- FIXEDFixes #559 — Html encoding issues with the empty state of the Compare and Search Commits views
- FIXEDFixes #574 — Apply Changes not working because of whitespace conflicts
- FIXEDFixes #589 — Bad revision for stash
- 9.1 DEC 2018
- NEWAdds more detailed branch tracking status (if available) to the Branches list in the Repositories view

  * Commits Behind — quickly see and explore the specific commits behind the upstream (i.e. commits that haven't been pulled)

  * Commits Ahead — quickly see and explore the specific commits ahead of the upstream (i.e. commits that haven't been pushed)

- NEWAdds the date and a changes indicator (+x ~x -x) to stashed changes in GitLens views
- NEWAdds the changed file status (added, modified, renamed, deleted, etc) to the tooltip of each revision in the File History and Line History views
- NEWAdds Git extended regular expression support to commit searches
- NEWAdds control over the menu commands contributed to the Source Control side bar to the GitLens interactive settings editor
- IMPROVEDChanges the Show Revision Details command to show file commit details
- IMPROVEDChanges the `alt`-command of the Toggle File Blame Annotations command to be the Toggle File Heatmap Annotations command
- IMPROVEDChanges searching for commits by message to be case-insensitive
- FIXEDFixes an issue where gravatar icons would sometimes not show up — thanks to PR #579 by sgtwilko (@sgtwilko)
- FIXEDFixes #33 — Commit messages can causes markdown formatting in hovers
- FIXEDFixes #501 — Azure DevOps ssh remotes aren't handled properly
- FIXEDFixes #523 — File History doesn't show all commits on file
- FIXEDFixes #552 — "Open Line Changes with..." doesn't work for renamed files
- FIXEDFixes #566 — History error with UNC
- FIXEDFixes #572 — Explorer can't expand some branch folders
- FIXEDFixes #584 — Unexpected results when opening diff from file history
- FIXEDFixes #588 — Output channel doesn't exist with `gitlens.outputLevel` default
- 9.0 DEC 2018
- NEWAdds GitLens over Visual Studio Live Share

  Live Share guests will now have read-only access to GitLens' features, provided both the host and guest have GitLens installed

- NEWAdds a new Git virtual file system provider for the `gitlens:` scheme — closes #430

  Replaces GitLens' internal handling of file revisions, which allows for better performance, as well as avoiding the use of temp files. It also provides a much better experience when dealing with file encodings, images, etc.

- NEWAdds an Explore the Repository from Here command which opens a virtual workspace folder (using the new Git virtual file system provider) for the repository at the specified point in time (commit, branch, tag, etc) — closes #398
- NEWAdds a new Repositories view, formerly the GitLens view, to visualize, navigate, and explore Git repositories — closes #456, #470, #494

  Provides a cleaner information-rich view of your opened repositories, more git commands (fetch, push, pull, checkout, stage, unstage, etc), better visibility and accessibility of existing features, and more

- NEWAdds a new File History view, formerly the History view, to visualize, navigate, and explore the revision history of the current file

  Provides similar features to the former History view as well as quickly toggling file tracking on and off, changing the base (branch, tag, commit, etc) of the file's history, and more

- NEWAdds an all-new Line History view to visualize, navigate, and explore the revision history of the selected lines of current file — closes #354

  Provides similar features to the File History view including quickly toggling line tracking on and off, changing the base (branch, tag, commit, etc) of the selected lines' history, and more

- NEWAdds an all-new Search Commits view to search and explore commit histories by message, author, files, id, etc — closes #455

  Provides somewhat similar features to the former Results view as well as it is now a persistent view, makes it easier to start a commit search, and more

- NEWAdds an all-new Compare view to visualize comparisons between branches, tags, commits, and more

  Provides somewhat similar and powerful features to the former Results view as well as it is now a persistent view, makes it easier to start a comparison, and more

- NEWReduces the overhead of all GitLens views — GitLens now only tracks changes and updates the views if they are visible, collapsed or hidden views should have almost zero overhead
- NEWAdds relative date markers (Less than a week ago, Over a week ago, Over a month ago, etc) to revision (commit) histories in GitLens views
- NEWAdds branch and tag tip markers to revision (commit) histories in GitLens views — closes #560
- NEWAdds a changes indicator (+x ~x -x) to commits in GitLens views — closes #493
- NEWAdds comparisons to commit ids, by prefixing with a `#`, in addition to branches and tags — closes #535
- NEWAdds support for git mailmap — closes #388
- NEWAdds support for Azure DevOps (formerly VSTS) remotes — closes #501
- NEWAdds better detection of on-prem BitBucket and GitLab remotes — closes #214
- NEWAdds some missing gitmojis — thanks to PR #510 by Loris Bettazza (@Pustur)
- NEWAdds a Directory Compare All Changes to open the configured git difftool to compare the working directory with HEAD — closes #569
- IMPROVEDChanges the sorting of branch, tags, and files in GitLens views to be a natural sort #547
- IMPROVEDChanges the Apply Changes command to truly apply only the patch of the specified change #539
- FIXEDFixes #405 — Secondary, blank repository appears repeatedly in Repositories view
- FIXEDFixes #430 — File revisions can end up being parsed by language servers (causing errors and warnings, etc)
- FIXEDFixes #496 — Short hash length doesn't match git's default length
- FIXEDFixes #503 — Open Changes (with difftool) opens one difftool window per changed file
- FIXEDFixes #507 — Restrict commit message size
- FIXEDFixes #527 — GitLens icon flashes on startup
- FIXEDFixes #533 — Some descriptions not using markdown properly in Settings GUI
- FIXEDFixes #544 — Some commit messages have one letter missing