Skip to content

Commit c6e5aa7

Browse files
Expands link documentation with descriptions and examples
1 parent 517abf6 commit c6e5aa7

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

docs/links.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22

33
This document covers the various VSCode link formats that work with GitLens, along with their formats, parameters and descriptions.
44

5+
## Contents
6+
7+
### Repository Items
8+
9+
- [Repository](#repository 'Jump to Repository')
10+
- [Branch](#branch 'Jump to Branch')
11+
- [Commit](#commit 'Jump to Commit')
12+
- [Tag](#tag 'Jump to Tag')
13+
- [Comparison](#comparison 'Jump to Comparison')
14+
- [File/Lines](#filelines 'Jump to File/Lines')
15+
16+
### GitKraken Cloud Items
17+
18+
- [Cloud Patch/Code Suggestion](#cloud-patchcode-suggestion 'Jump to Cloud Patch/Code Suggestion')
19+
- [Cloud Workspace](#cloud-workspace 'Jump to Cloud Workspace')
20+
21+
### GitKraken Account Links
22+
23+
- [Login](#login 'Jump to Login')
24+
525
## Notation
626

727
The following are used in link notation in this document:
@@ -34,12 +54,24 @@ The following are used in link notation in this document:
3454

3555
### Repository
3656

57+
#### Description
58+
59+
Used to open a (remote) repository in GitLens. Once the repository is opened, the Commit Graph will open to that repository.
60+
3761
#### Format
3862

3963
_{prefix}/r/{repoId}?{baseQuery}_
4064

65+
#### Example Usage
66+
67+
Right click a remote in the Remotes view and choose "Share -> Copy Link to Repository", and share with a teammate. When they access the link, GitLens will help them clone the repository, open it in GitLens, add the remote you linked, and open the Commit Graph to the repository, step-by-step.
68+
4169
### Branch
4270

71+
#### Description
72+
73+
Used to open a (remote) branch in GitLens. Once the branch's repository is opened, GitLens will open the Commit Graph to that repository and select the branch, or perform another action if specified (see _{action}_ in _References_ below).
74+
4375
#### Format
4476

4577
_{prefix}/r/{repoId}/b/{branchName}?{baseQuery}(&action={action})_
@@ -58,8 +90,16 @@ _{prefix}/r/{repoId}/b/{branchName}?{baseQuery}(&action={action})_
5890

5991
- _switch-to-pr-worktree_: Does everything that the _switch-to-pr_ action does, but always chooses to open the branch in a worktree, creating a new one if needed and creating a new local branch if needed. For creating the local branch and worktree, default options are chosen. The worktree is then opened in a new window.
6092

93+
#### Example Usage
94+
95+
Right click a branch in the Commit Graph and choose "Share -> Copy Link to Branch", select a remote to copy the branch for, and share with a teammate. When they access the link, GitLens will help them clone the repository, open it in GitLens, add the remote you linked, and open the Commit Graph to the branch, step-by-step.
96+
6197
### Commit
6298

99+
#### Description
100+
101+
Used to open a (remote) commit in GitLens. Once the commit's repository is opened, GitLens will open the Commit Graph to that repository and select the commit.
102+
63103
#### Format
64104

65105
_{prefix}/r/{repoId}/c/{commitSha}?{baseQuery}_
@@ -68,8 +108,16 @@ _{prefix}/r/{repoId}/c/{commitSha}?{baseQuery}_
68108

69109
- _{commitSha}_ is the full SHA of the commit.
70110

111+
#### Example Usage
112+
113+
Right click a commit in the Commit Graph and choose "Share -> Copy Link to Commit", select a remote to copy the commit for, and share with a teammate. When they access the link, GitLens will help them clone the repository, open it in GitLens, add the remote you linked, and open the Commit Graph to the commit, step-by-step.
114+
71115
### Tag
72116

117+
#### Description
118+
119+
Used to open a (remote) tag in GitLens. Once the tag's repository is opened, GitLens will open the Commit Graph to that repository and select the tag.
120+
73121
#### Format
74122

75123
_{prefix}/r/{repoId}/t/{tagName}?{baseQuery}_
@@ -78,8 +126,16 @@ _{prefix}/r/{repoId}/t/{tagName}?{baseQuery}_
78126

79127
- _{tagName}_ is the name of the tag. Note that the remote name should not be included. Instead, _{remoteUrl}_ is used to determine the remote for the tag. So if the tag _15.2.0_ is located on _origin_, for example, _{tagName}_ should just be _15.2.0_ and the remote url of _origin_ should be used for the _{remoteUrl}_ parameter. You should not set _{tagName}_ to _origin/15.2.0_ in this example.
80128

129+
#### Example Usage
130+
131+
Right click a tag in the Tags View and choose "Share -> Copy Link to Tag", select a remote to copy the tag for, and share with a teammate. When they access the link, GitLens will help them clone the repository, open it in GitLens, add the remote you linked, and open the Commit Graph to the tag, step-by-step.
132+
81133
### Comparison
82134

135+
#### Description
136+
137+
Used to open a comparison between two references in the _Search & Compare_ view.
138+
83139
#### Format
84140

85141
_{prefix}/r/{repoId}/compare/{ref1}[..|...]{ref2}?{baseQuery}(&prRepoUrl={prRepoUrl})_
@@ -90,8 +146,16 @@ _{prefix}/r/{repoId}/compare/{ref1}[..|...]{ref2}?{baseQuery}(&prRepoUrl={prRepo
90146

91147
- _{prRepoUrl}_ is an optional parameter, generally used for Pull Request comparisons, representing the pull URL of the git remote that represents the head commit of the Pull Request. It is formatted similar to _{remoteUrl}_, so see Common References section above to learn how to format it.
92148

149+
#### Example Usage
150+
151+
Share the changes of a pull request by right clicking the pull request's branch in the Commit Graph and choose "Compare with Common Base". The changes should be opened in the _Search & Compare_ view. Right click the Comparison item in the _Search & Compare_ view and choose "Share -> Copy Link to Comparison", and choose a remote to copy the comparison for. Share the link with a teammate. When they access the link, GitLens will help them clone the repository, open it in GitLens, add the remote, and open the _Search & Compare_ view to the pull request's changes, step-by-step.
152+
93153
### File/Lines
94154

155+
#### Description
156+
157+
Used to open a repository to a file, or specific lines of code within a file. Can open a file at a particular reference point or target the working copy of the file. Will highlight the specified lines of code if included.
158+
95159
#### Format
96160

97161
_{prefix}/r/{repoId}/f/{filePath}?{baseQuery}(&lines={lines})(&ref={ref})_
@@ -104,6 +168,10 @@ _{prefix}/r/{repoId}/f/{filePath}?{baseQuery}(&lines={lines})(&ref={ref})_
104168

105169
- _{ref}_ is an optional parameter representing the ref at which the file is referenced. Can be a branch name or tag name, fully qualified ref like _refs/tags/…_ or a commit SHA/revision. If this is not supplied, the link points to the working version of the file.
106170

171+
#### Example Usage
172+
173+
To guide a teammate to a specific line of code, right click the line in the editor and choose "Share -> Copy Link to Code". Then choose which remote to target. If you prefer to target a block of code or multiple lines, highlight the lines and then right click the highlighted code and choose "Copy As -> Copy Link to Code". Then share the link with a teammate. When they access the link, GitLens will help them clone the repository, open it in GitLens, add the remote, and open the file to the specified lines of code, step-by-step.
174+
107175
## GitKraken Cloud Item Deep Links
108176

109177
### Common References
@@ -116,6 +184,10 @@ _{prefix}/r/{repoId}/f/{filePath}?{baseQuery}(&lines={lines})(&ref={ref})_
116184

117185
### Cloud Patch/Code Suggestion
118186

187+
#### Description
188+
189+
Used to open a cloud patch or code suggestion in GitLens.
190+
119191
#### Format
120192

121193
_{prefix}/drafts/{draftId}(?patch={patchId})(&type=suggested_pr_change&prEntityId={prEntityId})_
@@ -130,8 +202,16 @@ _{prefix}/drafts/{draftId}(?patch={patchId})(&type=suggested_pr_change&prEntityI
130202

131203
- _{prEntityId}_ refers to the GK entity identifier for the Pull Request related to the code suggestion.
132204

205+
#### Example Usage
206+
207+
When you create a cloud patch from the _Cloud Patches_ view, you will receive a notification that the cloud patch has been successfully created. On that notification is a "Copy Link" button. Click it to copy a link to the cloud patch to your clipboard. Share the link with a teammate (ensure that the teammate has access based on the permissions/visibility you set for the cloud patch). When they access the link, GitLens will help them open the cloud patch in GitLens and view the patch changes, and even apply the changes to their local repository.
208+
133209
### Cloud Workspace
134210

211+
#### Description
212+
213+
Used to open a cloud workspace in GitLens.
214+
135215
#### Format
136216

137217
_{prefix}/workspace/{workspaceId}_
@@ -140,10 +220,18 @@ _{prefix}/workspace/{workspaceId}_
140220

141221
- _{workspaceId}_ is the ID of the cloud workspace.
142222

223+
#### Example Usage
224+
225+
Right click a cloud workspace in the _GK Workspaces_ view and choose "Share -> Copy Link to Workspace". Use this link to open the view to the chosen workspace in GitLens.
226+
143227
## GitKraken Account Links
144228

145229
### Login
146230

231+
#### Description
232+
233+
Used to log in to a GitKraken account from GitLens.
234+
147235
#### Format
148236

149237
_vscode://eamodio.gitlens/login?code={code}(&state={state})(&context={context})_
@@ -157,3 +245,7 @@ _vscode://eamodio.gitlens/login?code={code}(&state={state})(&context={context})_
157245
- _{context}_ is an optional parameter representing the context of the login. Currently supported values include:
158246

159247
- _start_trial_ - Log in to start a Pro trial.
248+
249+
#### Example Usage
250+
251+
External sources, such as GitKraken web pages, can use these links internally to get you into GitLens and logged in to your GitKraken account.

0 commit comments

Comments
 (0)