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.
- When your workspace has started, in the Web Terminal find the
~/.ssh/id_rsa.pub
key and authorize its access to your GitHub repository. Check connecting to GitHub with SSH for more help.dangerBe 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.
- 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.
Test the connection with the Git repo. Run a sample Ray script (for example,
python main.py
) in the Web Terminal, JupyterLab terminal or VSCode terminal and verify it's working as intended.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