From d333535e768f349021a39a78c3afcc75f950f0c3 Mon Sep 17 00:00:00 2001 From: Oscar Villavicencio Date: Mon, 24 Nov 2025 02:32:44 -0800 Subject: [PATCH] docs: Document `git_hosting_providers` for self-hosted Git instances (#43278) Closes #38433 Document how to register self-hosted GitHub/GitLab/Bitbucket instances via git_hosting_providers setting so permalinks and issue links resolve. Release Notes: - Added documentation on how to register self-hosted GitHub/GitLab/Bitbucket instances via the `git_hosting_providers` setting. This ensures permalinks and issue links can be resolved for these instances. --- docs/src/configuring-zed.md | 28 ++++++++++++++++++++++++++++ docs/src/git.md | 14 ++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/docs/src/configuring-zed.md b/docs/src/configuring-zed.md index 6edcafb3d8f275047ba953cdf6644604709f7f22..cf86a0a6e7a6c4426f5a55d246f93b5c51be9792 100644 --- a/docs/src/configuring-zed.md +++ b/docs/src/configuring-zed.md @@ -4693,6 +4693,34 @@ See the [debugger page](./debugger.md) for more information about debugging supp - `collapse_untracked_diff`: Whether to collapse untracked files in the diff panel - `scrollbar`: When to show the scrollbar in the git panel +## Git Hosting Providers + +- Description: Register self-hosted GitHub, GitLab, or Bitbucket instances so commit hashes, issue references, and permalinks resolve to the right host. +- Setting: `git_hosting_providers` +- Default: `[]` + +**Options** + +Each entry accepts: + +- `provider`: One of `github`, `gitlab`, or `bitbucket` +- `name`: Display name for the instance +- `base_url`: Base URL, e.g. `https://git.example.corp` + +You can define these in user or project settings; project settings are merged on top of user settings. + +```json [settings] +{ + "git_hosting_providers": [ + { + "provider": "github", + "name": "BigCorp GitHub", + "base_url": "https://git.example.corp" + } + ] +} +``` + ## Outline Panel - Description: Customize outline Panel diff --git a/docs/src/git.md b/docs/src/git.md index 85781e37bc628ac493a048b5b7d16d1fbd758d72..b31d9db585e0ff8ba9a2181903037028994a099c 100644 --- a/docs/src/git.md +++ b/docs/src/git.md @@ -146,6 +146,20 @@ Zed currently supports links to the hosted versions of [SourceHut](https://sr.ht) and [Codeberg](https://codeberg.org). +For self-hosted GitHub, GitLab, or Bitbucket instances, add them to the `git_hosting_providers` setting so commit hashes and permalinks resolve to your domain: + +```json [settings] +{ + "git_hosting_providers": [ + { + "provider": "gitlab", + "name": "Corp GitLab", + "base_url": "https://git.example.corp" + } + ] +} +``` + Zed also has a Copy Permalink feature to create a permanent link to a code snippet on your Git hosting service. These links are useful for sharing a specific line or range of lines in a file at a specific commit. Trigger this action via the [Command Palette](./getting-started.md#command-palette) (search for `permalink`),