vscode-gitlens icon indicating copy to clipboard operation
vscode-gitlens copied to clipboard

Change the URL used in "Open File in Remote" and "Copy Remote File URL"

Open dushan-terzikj-grammarly opened this issue 11 months ago • 1 comments

Hello all,

I am using Gitlens on VSCode on Mac and I am a noob with VSCode. When I use "Open File in Remote" or "Copy Remote File URL", I get the following URL (this is an example):

"https://ssh.my.gitlab-server.com/..."

While this is not incorrect as I cloned the repo via SSH, I cannot open this link I have to remove the ssh. part. This is not a blocker but it is quite annoying. How can I make Gitlens generate the correct link?

Correct link: "https://my.gitlab-server.com/..."

I tried adding gitlens.remote in settings as such:

"gitlens.remotes": [
    {
      "domain": "my.gitlab-server.com",
      "type": "GitLab",
      "protocol": "https",
      "urls": {
        "repository": "https://my.gitlab-server.com/${repo}",
        "branches": "https://my.gitlab-server.com/${repo}/branches",
        "branch": "https://my.gitlab-server.com/${repo}/commits/${branch}",
        "commit": "https://my.gitlab-server.com/${repo}/commit/${id}",
        "file": "https://my.gitlab-server.com/${repo}?path=${file}${line}",
        "fileInBranch": "https://my.gitlab-server.com/${repo}/blob/${branch}/${file}${line}",
        "fileInCommit": "https://my.gitlab-server.com/${repo}/blob/${id}/${file}${line}",
        "fileLine": "#L${line}",
        "fileRange": "#L${start}-L${end}"
      }
    }
  ]

This does not fix the issue.

Thank you in advance!

Discussion here: https://github.com/gitkraken/vscode-gitlens/discussions/3961

Try changing type to custom.

aeharding avatar Sep 19 '25 17:09 aeharding