Creating a New Capsule by Cloning a Git Repository

Clone the Git Repository

  1. Click New Capsule and select Clone From <your predefined GitHub organization>.

  2. Enter the Name or URL of the Git repo to clone. The repo is cloned to the capsule. This can be verified by checking the provider's icon.

The preconfigured Git organization shown here is called codeocean, you should see your organization name on the menu.

Switching Branches

Switching between the different Git branches is available in your capsule's Git repository via the drop-down menu shown below. The default branch is master unless defined otherwise in the remote Git repository. You can also create and delete Git branches from within a Cloud Workstation session.

Once you start editing the capsule, the drop-down button for switching branches is disabled until all of the changes are committed.

This feature is especially useful when the capsule is linked to an external Git repository for example GitHub, GitLab, etc.

You can create and delete Git branches from within a Cloud Workstation session. This will be synced into your capsule and reflect in the Git branch list of the drop-down menu.

Sync with Git via a Capsule

After the Git repo is cloned into a capsule, you can sync with the repo in a Cloud Workstation by using Git commands to push or pull as you would locally.

For more information about setting up a Cloud Workstation, see Getting Started.

Commit in the Capsule

You can commit in the capsule integrated development environment (IDE). Commits are stored within the capsule until they are manually pushed to GitHub in a Cloud Workstation.

Duplicating a Capsule Linked to a Git Repo

There are two options when duplicating a capsule linked to a Git repo.

  • Link to Git repository

This option allows you to sync with your original Git repo from the new capsule. You’ll need access to that repo.

  • Create a new repository in Code Ocean

This option does not link the capsule to the original Git repo, it has its own git repo on Code Ocean’s server.

Last updated