|
1 | 1 | # Context URLs
|
2 | 2 |
|
3 |
| - * [GitHub Project Context](#github-project-context) |
4 |
| - * [GitHub File Context](#github-file-context) |
5 |
| - * [GitHub Issue Context](#github-issue-context) |
6 |
| - * [GitHub Pull Request Context](#github-pull-request-context) |
| 3 | + * [Repository Context](#repository-context) |
| 4 | + * [Branch Context](#branch-context) |
| 5 | + * [Pull/Merge Request Context](#pull-merge-request-context) |
| 6 | + * [Issue Context](#issue-context) |
| 7 | + * [File Context](#file-context) |
7 | 8 |
|
8 | 9 | Gitpod derives the workspace context from the URL of the repository page from which it was
|
9 |
| -started. Different issues, pull requests, or branches will result in different workspaces, allowing |
10 |
| -developers to easily perform individual tasks in their own isolated environments. |
| 10 | +started. Different issues, pull/merge requests, or branches will result in different workspaces, allowing |
| 11 | +developers to easily perform different tasks in different isolated environments. |
11 | 12 |
|
12 | 13 | Each workspace includes a full Linux container. From the IDE's terminal, the user can directly
|
13 | 14 | access all development tools of the Linux system and even install missing ones.
|
14 | 15 |
|
15 | 16 | In the following we describe the supported contexts and what they do:
|
16 | 17 |
|
17 |
| -## GitHub Project Context |
| 18 | +## Repository Context |
18 | 19 |
|
19 |
| -Creating a Gitpod workspace from the project's base URL does not carry a lot of context. |
20 |
| -Gitpod will check out the `master` branch and open the `Readme.md` if it exists. |
| 20 | +When you create a Gitpod workspace from the project's base URL (i.e. the repository URL), |
| 21 | +Gitpod will clone this repository, check out the default branch, and open the `README.md` if it exists. |
21 | 22 |
|
22 |
| -An example for this context is: |
| 23 | +An example URL for the repository context is: |
23 | 24 |
|
24 | 25 | ```
|
25 |
| -https://github.com/arunoda/learnnextjs-demo |
| 26 | +gitpod.io/#https://gitlab.com/gitpod/spring-petclinic |
26 | 27 | ```
|
27 | 28 |
|
28 |
| -## GitHub File Context |
| 29 | +## Branch Context |
29 | 30 |
|
30 |
| -The file context is an extension to the project context, in that Gitpod will check out the |
31 |
| -corresponding branch and open the respective file in an editor. |
| 31 | +You can also create a Gitpod workspace for a specific branch in a repository. This is similar to the repository context, except that Gitpod will automatically check out the requested branch instead of the repository's default branch. |
32 | 32 |
|
33 |
| -An example for this context is: |
| 33 | +An example URL for the branch context is: |
34 | 34 |
|
35 | 35 | ```
|
36 |
| -https://github.com/arunoda/learnnextjs-demo/blob/getting-started/pages/index.js |
| 36 | +gitpod.io/#https://gitlab.com/gitpod/spring-petclinic/-/tree/my-branch |
37 | 37 | ```
|
38 | 38 |
|
39 |
| -When pointing to a directory, e.g. |
| 39 | +Note that this also works with specific commit SHAs: |
| 40 | + |
40 | 41 | ```
|
41 |
| -https://github.com/arunoda/learnnextjs-demo/tree/create-dynamic-pages/pages |
| 42 | +gitpod.io/#https://gitlab.com/gitpod/spring-petclinic/-/commit/426b99d57ce511022eb71a60bff8e0764806ddf5 |
42 | 43 | ```
|
43 |
| -`Readme.md` will be opened if it exists there. |
44 | 44 |
|
45 |
| -## GitHub Issue Context |
| 45 | +## Pull/Merge Request Context |
46 | 46 |
|
47 |
| -When starting a workspace from a GitHub issue, a local branch named `GH-{issue-number}` will be |
48 |
| -created, based on the remote's default branch. In most cases that will be `origin/master`. |
| 47 | +Starting workspaces from a Pull Request or Merge Request will clone the respective branch, and show the file |
| 48 | +changes of the PR/MR in a view on the left. The first change is opened in the diff editor. |
| 49 | +Also the `Pull Request` view on the right is configured to reflect the PR/MR information. |
| 50 | + |
| 51 | +This context is meant for code reviews, or to take action on feedback you got from a reviewer. |
| 52 | + |
| 53 | +## Issue Context |
| 54 | + |
| 55 | +When starting a workspace from an issue, a local branch suffixed with `-{issue-number}` will be |
| 56 | +created, based on the repository's default branch. (In most cases that will be `origin/master`.) |
49 | 57 |
|
50 | 58 | In addition, the commit message is preconfigured with:
|
51 | 59 |
|
52 | 60 | ```
|
53 | 61 | fixes #{organization}/{repo}#{issue-number}
|
54 | 62 | ```
|
55 | 63 |
|
56 |
| -This will automatically close the GitHub issue once such a commit is merged into the default branch. |
| 64 | +This will automatically close the issue once such a commit is merged into the default branch. |
57 | 65 |
|
58 | 66 | As soon as changes have been committed locally, the `Pull Request` view on the right can be used to
|
59 | 67 | push changes to a remote repository and create a pull request.
|
60 | 68 |
|
61 |
| -## GitHub Pull Request Context |
| 69 | +## File Context |
| 70 | + |
| 71 | +The file context is an extension to the repository context, in that Gitpod will check out the |
| 72 | +corresponding branch and open the respective file in an editor. |
| 73 | + |
| 74 | +An example for this context is: |
| 75 | + |
| 76 | +``` |
| 77 | +gitpod.io/#https://gitlab.com/gitpod/spring-petclinic/-/blob/master/src/main/java/org/springframework/samples/petclinic/owner/Pet.java |
| 78 | +``` |
| 79 | + |
| 80 | +When pointing to a directory, e.g. |
| 81 | +``` |
| 82 | +gitpod.io/#https://gitlab.com/gitpod/spring-petclinic/-/blob/master/src/main/java/org/springframework/samples/petclinic |
| 83 | +``` |
| 84 | +`README.md` will be opened if it exists there. |
62 | 85 |
|
63 |
| -Starting workspaces from pull requests will clone the respective branch and open the file |
64 |
| -changes of the PR in a view on the left. The first change is opened in the diff editor. |
65 |
| -Also the `Pull Request` view on the right is configured to reflect the PR information. |
| 86 | +## See Also |
66 | 87 |
|
67 |
| -This context is meant for code reviews or to take action on feedback you got from a reviewer. |
| 88 | +- [Passing environment variables via the context URL](/docs/environment-variables/#passing-in-environment-variables) |
| 89 | +- [Triggering a prebuild using a special context URL](/docs/prebuilds/#manual-execution-of-prebuild) |
0 commit comments