gh codespace rebuild -c cs-name --full

Category: GitHub CLI

gh codespace rebuild -c cs-name --full

Fully rebuild a codespace container

Rebuilds the codespace's dev container from its definition, and --full skips cached layers for a clean build. Use it when devcontainer.json changes or the environment is corrupted. A rebuild recreates the container but keeps your files.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.