Skip to main content

Git integration

Workspaces provide seamless integration with Git repos. Everything tracked by Git, including uncommitted changes (that's not included in the .gitignore), will be persisted.

When you first create a Workspace, Anyscale generates a unique SSH key tied to your user account. This SSH key is available in ~/.ssh/id_rsa in your Workspace cluster. You can authorize this generated key for access to GitHub or other services.

  1. When your workspace has started, in the Web Terminal find the ~/.ssh/ key and authorize its access to your GitHub repository. Check connecting to GitHub with SSH for more help. GitHub

    Be aware that this key is not currently stored securely in a key store, so it is possible your coworkers could get access to this key. Make sure the key has appropriately scoped permissions.

  2. Clone a Git repo (git clone <remote_repo>) into the working directory. Working directory is: /home/ray/<project_name>, for example /home/ray/default. Read more about Projects.
  1. Test the connection with the Git repo. Run a sample Ray script (for example, python in the Web Terminal, JupyterLab terminal or VSCode terminal and verify it's working as intended.

  2. Terminate your workspace, and start it again. Verify that the Git repository state is restored in the working directory of your workspace. Your connection with the Git repository is now ready