GitLens Documentation

Gitlens Integrations

GitLens provides rich integrations with many remote providers, including GitHub, GitHub Enterprise, GitLab, Gitea, Gerrit, Bitbucket, Bitbucket Server, and Azure DevOps. You can also define custom remote providers or remote providers with custom domains as well.

Basic integrations provide issue and pull request auto-linking, while richer integrations (e.g. GitHub or GitLab) offer the ability to work with the Launchpad, can provide rich hover information provided for auto-linked issues and pull requests, associate pull requests with branches and commits, and provide avatars.

Additionally, these integrations provide commands to copy the url of or open, files, commits, branches, and the repository on the remote provider.

  • Open File from Remote command (gitlens.openFileFromRemote) — opens the local file from a url of a file on a remote provider
  • Open File on Remote command (gitlens.openFileOnRemote) — opens a file or revision on the remote provider
  • Copy Remote File Url command (gitlens.copyRemoteFileUrlToClipboard) — copies the url of a file or revision on the remote provider
  • Open File on Remote From… command (gitlens.openFileOnRemoteFrom) — opens a file or revision on a specific branch or tag on the remote provider
  • Copy Remote File Url From… command (gitlens.copyRemoteFileUrlFrom) — copies the url of a file or revision on a specific branch or tag the remote provider
  • Open Commit on Remote command (gitlens.openCommitOnRemote) — opens a commit on the remote provider
  • Copy Remote Commit Url command (gitlens.copyRemoteCommitUrl) — copies the url of a commit on the remote provider
  • Open Branch on Remote command (gitlens.openBranchOnRemote) — opens the branch on the remote provider
  • Copy Remote Branch Url command (gitlens.copyRemoteBranchUrl) — copies the url of a branch on the remote provider
  • Open Branches on Remote command (gitlens.openBranchesOnRemote) — opens the branches on the remote provider
  • Copy Remote Branches Url command (gitlens.copyRemoteBranchesUrl) — copies the url of the branches on the remote provider
  • Open Comparison on Remote command (gitlens.openComparisonOnRemote) — opens the comparison on the remote provider
  • Copy Remote Comparison Url command (gitlens.copyRemoteComparisonUrl) — copies the url of the comparison on the remote provider
  • Open Pull Request command (gitlens.openPullRequestOnRemote) — opens the pull request on the remote provider
  • Copy Pull Request Url command (gitlens.copyRemotePullRequestUrl) — copies the url of the pull request on the remote provider
  • Open Repository on Remote command (gitlens.openRepoOnRemote) — opens the repository on the remote provider
  • Copy Remote Repository Url command (gitlens.copyRemoteRepositoryUrl) — copies the url of the repository on the remote provider

Connecting the GitHub and GitLab Integration

The GitHub and GitLab integration are connected via your GitKraken account from gitkraken.dev. To connect an integration, open the Command Palette (command/ctrl+shift+P) and type GitLens: Manage Integrations. You can also navigate to GitKraken Account in the GitLens Activity Bar and select Integrations.

You will be prompted to log into your GitKraken account if you are not already. Then, select Connect with GitHub or Connect with GitLab and sign into the desired service. You will have the option to connect multiple integrations if needed. Finish the process by selecting Complete Setup to hop back into VS Code and begin working with the integrations.

Community users are limited to basic functionality only.

GitHub Enterprise Server and GitLab Self-Managed Integration PRO

GitLens Pro offers a richer integration with GitHub Enterprise Server and GitLab Self-Managed.

Once authenticated, GitLens will enrich GitHub Enterprise Server or GitLab Self-Managed autolinks in the hovers. You’ll see your GitHub Enterprise Server or GitLab Self-Managed avatar, links to related pull requests, along with a footnote of the pull request or issue details. You’ll see similar details from the Sidebar views for any commit or branch associated with a pull request or issue.

Connecting GitHub Enterprise Server or GitLab Self-Managed

To connect either the GitHub Enterprise Server or GitLab Self-Managed integration:

  • Open the settings.json – this can be done from the command palette (command/ctrl + shift + P) > Preferences: Open User Settings (JSON)

  • Provide a gitlens.remote with a domain and a type with the below format – for more information on the formatting see the remote provider integration settings

Format Example:

"gitlens.remotes": [{ "domain": "git.corporate-url.com", "type": "GitHub" }]

Or

"gitlens.remotes": [{ "domain": "git.corporate-url.com", "type": "GitLab" }]
  • Open a GitHub Enterprise Server or GitLab Self-Managed repository in VS Code

  • Open the Remotes View

  • Select Connect to Remote – if you do not see this option, check that the format of the settings.json matches the example above

  • You will then be prompted to provide a PAT with the required scopes and can hit Enter to complete the integration connection

Jira Integration PRO

The Jira Integration connected through your GitKraken Account gives you access to Jira Autolinks anywhere autolinks are supported in GitLens. Simply connect the integration and GitLens will automatically convert Jira IDs in commit messages to links i.e. ABC-123.

This Feature is only available for Pro subscription tiers or higher

To connect the integration, open the GitLens Sidebar, select Cloud Integrations from the GitKraken Account view, select Jira Cloud, and proceed with the integration connection by allowing GitKraken access to your Atlassian Account. You can also open Integration Settings in a browser.

Have feedback about this article? Did we miss something? Let us know!
On this page