Version Control

Code Ocean uses Git for version control. Each Capsule is a Git repository, and you can perform Git operations via either the IDE or any command-line interface (CLI) in a Cloud Workstation.

Each file or folder has a small status icon that indicates its status in Git:

Icon

Is tracked by Git?

Is committed?

Yes

Yes

Yes

No

No

No

The yellow icons of files and folders turn green after selecting Commit Changes.

Additional options from Cloud Workstation

The Capsule IDE currently does not offer Git features beyond committing and diffing. Advanced Git operations like revert, log, remote, etc. can be done with CLI in a Cloud Workstation.

You can also amend the git commit comment in the terminal from a Cloud Workstation.

.gitignore

Duplicate a Capsule

When you duplicate a Capsule, you copy both the committed history and the uncommitted changes.

  1. From the top menu, click Capsule and select Duplicate. You are redirected to the duplicated Capsule.

  2. Click Show Prior History to view the commit history from the parent Capsule.

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 (e.g. GitHub, GitLab, etc.).

You can also create and delete Git branches, as well as other commands part of the native Git experience from within a Cloud Workstation session. This will be synced into your Capsule as well and reflected in the Git branch list in the drop-down menu, and the other relevant locations.