Skip to main content
Documentation
CLI Reference

Local File Commands

Stage, restore, commit, temporarily set aside, clean, and archive local repository content.

CommandCurrent behaviorUsage
addStage one or more local files or directoriesdits add <PATH>...
restoreRestore or unstage selected local pathsdits restore <PATH>... [OPTIONS]
commitCreate a local commit from the indexdits commit -m <MESSAGE>
stashManage local working-tree stashesdits stash [ACTION] [OPTIONS]
cleanPreview or remove untracked working-tree pathsdits clean (-n | -f) [OPTIONS] [PATH]...
archiveArchive paths selected by a local ref using available worktree bytesdits archive [TREE_ISH] [OPTIONS]

dits add

Stages each supplied file or directory for the next commit. The command has no current flags: options such as --all, --dry-run, --patch, and --forceare not accepted.

dits add notes.txt
dits add footage/ graphics/
dits add .
dits status

dits restore

Restores required paths from the default source or a commit selected with --source. Use --staged to unstage and --worktree to select the working tree explicitly. The parser also accepts --ours and --theirs, but merge-conflict restoration is not complete in this alpha.

dits restore notes.txt
dits restore --source <commit-id> footage/scene.mov
dits restore --staged notes.txt
dits restore --worktree notes.txt

dits commit

Creates a local commit from staged state. A message is required.

dits commit --message "Add review assets"

dits stash

Supported actions are push, pop, apply, list, drop, clear, and show. Use --messagewith push and --index to choose a stash for an action that accepts one.

dits stash push --message "Before alternate cut"
dits stash list
dits stash show --index 0
dits stash apply --index 0
dits stash drop --index 0

dits clean

Operates on untracked working-tree paths, not historical repository objects. Preview mode or force is required. -d includes directories, -x includes ignored files, -Xselects only ignored files, and --exclude preserves matching paths.

# Always preview the exact scope first
dits clean --dry-run
dits clean --dry-run -d renders/

# Destructive: removes the previewed untracked paths from the working tree
dits clean --force -d renders/

dits archive

Creates tar, tar.gz, or zip output. A resolvable local commit, branch, or tag selects the manifest paths, but the current implementation reads available bytes from the working tree and skips selected paths that are absent there. Verify the archive; do not treat it as a guaranteed byte-exact historical export. Use --prefix to place members below a directory, --output to select the file, and trailing paths to limit the selection.

dits archive HEAD --format tar.gz --output review.tar.gz
dits archive main --format zip --output footage.zip -- footage/

Use dits <command> --help for exact parser syntax and see maintenance commands for integrity and storage inspection.