0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Backlog上のgitリポジトリのファイルを開くURLをVSCodeのGitLensで取得する

Last updated at Posted at 2023-02-08

VSCodeの拡張機能のGitLensの機能で、右クリックメニューの「形式を指定してコピー」から、そのファイルをgitリポジトリのホストサイト上で開けるURLを取得することができると思います。

image.png

しかしこの機能はBacklog上のリポジトリの場合、デフォルトのままだとURLをちゃんと取得できなかったので、設定内容のメモです。

(参考:https://github.com/gitkraken/vscode-gitlens#remote-provider-integration-settings- )

設定内容

.vscode/settings.json に次の内容を適当に変更して追加すれば完了です。

.vscode/settings.json
    "gitlens.remotes": [{
        "domain": "hoge.backlog.jp",
        "type": "Custom",
        "name": "hoge namae",
        "protocol": "https",
        "urls": {
            "repository": "https://hoge.backlog.jp/${repo}",
            "branches": "https://hoge.backlog.jp/${repo}/branches",
            "branch": "https://hoge.backlog.jp/${repo}/commits/${branch}",
            "commit": "https://hoge.backlog.jp/${repo}/commit/${id}",
            "file": "https://hoge.backlog.jp/${repo}?path=${file}${line}",
            "fileInBranch": "https://hoge.backlog.jp/${repo}/blob/${branch}/${file}${line}",
            "fileInCommit": "https://hoge.backlog.jp/${repo}/blob/${id}/${file}${line}",
            "fileLine": "#${line}",
            "fileRange": "#${start}-${end}"
        }
    }]

backlogだと行の指定が#12のように数字の前にLが不要なのがgithubと違っていて注意ですね。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?