JetBrains CodeCanvas 2024.3 Help

Connect GitHub Repository

  1. Select Namespaces in the header navigation, then in the sidebar menu, select the namespace you need.

  2. In the sidebar namespace menu, select Repositories.

  3. Click New connection.

  4. Provide a repository Name and other settings:

    • Remote repository URL – the SSH or HTTPS URL of the repository, e.g., git@github.com:MyCompany/my-project.git or https://github.com/MyCompany/my-project.git

    • Repository web URL – the URL of the remote repository's web interface. CodeCanvas will show this link in the repository list. For example, this can be a link to the project's README file on GitHub.

    • Access control – specify who is allowed to view repository contents: Only selected users or All users.

      In the case of Only selected users, you should synchronize this list with your Git hosting service. Learn more

  5. If the repository doesn't require authentication, leave Anonymous in Authentication and click Connect. Otherwise, choose either SSH (for SSH authentication) or Password (for HTTPS authentication).

    For SSH authentication, you need to provide an SSH key pair. CodeCanvas will use the private key only to clone the repository into dev environments. Users will be required to specify their own SSH key to pull from and push to the repository.

    You can create a new SSH key pair manually or make CodeCanvas generate it for you.

    1. In the Authentication field, select SSH and ensure Auto-generate SSH keys is turned on.

    2. Click Connect and copy the generated public key.

    3. On GitHub, go to the repository | Settings | Deploy keys and click Add deploy key. Paste the public key into the Key field and click Add key.

      Git key
    4. In CodeCanvas, you can now Test connection or Close the dialog. The repository will appear in the Repositories list.

    1. Generate a new SSH key pair for CodeCanvas. On your local machine, run:

      ssh-keygen -t ed25519

      During key pair generation, you can additionally protect the private key with a passphrase. Finally, your current directory will contain a pair of files, e.g., mykey (private key) and mykey.pub (public key).

    2. On GitHub, go to the repository | Settings | Deploy keys and click Add deploy key. Paste the contents of the public key file (mykey.pub) into the Key field and click Add key.

      Git key
    3. In CodeCanvas, in the Authentication field, select SSH and turn off Auto-generate SSH keys.

    4. Provide the private key file (mykey) and the passphrase (if you've specified it during key pair generation).

      Connect Git repo
    5. You can first Test connection, and if everything is OK, click Connect. After this, the repository will appear in the Repositories list.

    For GitHub, you can generate a personal access token and use it as the password. CodeCanvas will use this token only to clone the repository into dev environments. Users will be required to specify their own GitHub credentials to pull from and push to the repository.

    1. On GitHub, go to your profile | Settings | Developer settings | Personal access tokens | Fine-grained tokens and click Generate new token.

      GitHub token
    2. In Repository access, select Only select repositories and select the repository you want to connect.

    3. In Permissions, in Contents, select Read-only.

    4. Click Generate token.

    5. Copy the token and specify it in CodeCanvas as a repository Password and your GitHub username as Username.

    6. You can first Test connection, and if everything is OK, click Connect. After this, the repository will appear in the Repositories list.

Last modified: 08 November 2024