Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

sync-codeocean.sh - Synchronize CodeOcean capsules with local repositories

Description

This script manages synchronization between CodeOcean capsules and local Git repositories. It maintains both a live Git clone and a static copy of a CodeOcean capsule, keeping them synchronized with the remote capsule.

Usage

./sync-codeocean.sh <codeocean-number>

Parameters

Workflow

  1. Creates or updates a live Git clone from CodeOcean (codeocean-{number}-live)

  2. Creates or updates a static copy without Git metadata (codeocean-{number})

  3. Synchronizes changes from the live clone to the static copy

  4. Stages changes in the current Git repository

Output Directories

Dependencies

Example

./sync-codeocean.sh 12345

Creates/updates:

Important Note

⚠️ Warning: The script removes all files in the static copy’s code directory before syncing to ensure a clean update. Make sure any local changes are committed before running this script.

How It Works

Step 1: Live Clone Management

Step 2: Static Copy Management

Use Cases

This script is particularly useful for:

File Synchronization

The script uses rsync -auv --exclude ".git" which:

This ensures the static copy contains only the content files without Git history.