Starting a new workspace with a clone of a Git repository

Working with Che in your browser involves multiple URLs:

  • The URL of your organization’s Che instance, used as part of all the following URLs

  • The URL of the Workspaces page of your Che dashboard with the workspace control panel

  • The URLs for starting a new workspace

  • The URLs of your workspaces in use

With Che, you can visit a URL in your browser to start a new workspace that contains a clone of a Git repository. This way, you can clone a Git repository that is hosted on GitHub, a GitLab instance, or a Bitbucket server.

You can also use the Git Repo URL * field on the Create Workspace page of your Che dashboard to enter the URL of a Git repository to start a new workspace.
Prerequisites
  • Your organization has a running instance of Che.

  • You know the FQDN URL of your organization’s Che instance: https://<che_fqdn>.

  • Optional: You have authentication to the Git server configured.

  • Your Git repository maintainer keeps the devfile.yaml or .devfile.yaml file in the root directory of the Git repository. (For alternative file names and file paths, see Optional parameters for the URLs for starting a new workspace.)

    You can also start a new workspace by supplying the URL of a Git repository that contains no devfile. Doing so results in a workspace with the Che-Theia IDE and the Universal Developer Image.
Procedure

To start a new workspace with a clone of a Git repository:

  1. Optional: Visit your Che dashboard pages to authenticate to your organization’s instance of Che.

  2. Visit the URL to start a new workspace using the basic syntax:

    https://<che_fqdn>#<git_repository_url>

    You can extend this URL with optional parameters:

    https://<che_fqdn>#<git_repository_url>?<optional_parameters> (1)
    Example 1. A URL for starting a new workspace

    https://<che_fqdn>#https://github.com/che-samples/cpp-hello-world

    Example 2. The URL syntax for starting a new workspace with a clone of a GitHub-hosted repository

    With GitHub and GitLab, you can even use the URL of a specific branch of the repository to be cloned:

    • https://<che_fqdn>#https://github.com/<user_or_org>/<repository> starts a new workspace with a clone of the default branch.

    • https://<che_fqdn>#https://github.com/<user_or_org>/<repository>/tree/<branch_name> starts a new workspace with a clone of the specified branch.

    • https://<che_fqdn>#https://github.com/<user_or_org>/<repository>/pull/<pull_request_id> starts a new workspace with a clone of the branch of the pull request.

    After you enter the URL to start a new workspace in a browser tab, it renders the workspace-starting page.

    When the new workspace is ready, the workspace IDE loads in the browser tab.

    A clone of the Git repository is present in the filesystem of the new workspace.

    The workspace has a unique URL: https://<che_fqdn>#workspace<unique_url>.

Although this is not possible in the address bar, you can add a URL for starting a new workspace as a bookmark by using the browser bookmark manager:

  • In Mozilla Firefox, go to > Bookmarks > Manage bookmarks Ctrl+Shift+O > Bookmarks Toolbar > Organize > Add bookmark.

  • In Google Chrome, go to > Bookmarks > Bookmark manager > Bookmarks bar > > Add new bookmark.