Version Control
Last updated
Was this helpful?
Last updated
Was this helpful?
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 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.
The .gitignore
file in the Capsule indicates files or folders that you want to exclude from version control. Git won't keep track of changes in these files. The files and folder in .gitignore
have a gray icon to indicate that these files aren’t tracked by Git. Code Ocean automatically adds/data/
to follow best practices of excluding data files in version control.
When you duplicate a Capsule, you copy both the committed history and the uncommitted changes.
From the top menu, click Capsule and select Duplicate. You are redirected to the duplicated Capsule.
Click Show Prior History to view the commit history from the parent Capsule.
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.