Skip to content

Repository Management

Repositories in WDG are project-scoped. Each project keeps its own repositories under projects/<project>/repositories/, with isolated git histories. There is no central/shared repository store and no top-level wdg repo command — every repository operation runs against a specific project using the project-first grammar:

bash
wdg <project> repo <action> [options]

Available actions: add, remove, list, attach, sync, status, hooks, init.

Add a Repository

bash
wdg <project> repo add <url> [branch] [options]

Clones a git repository into the project, wires it into docker-compose.override.yml as a mount so the WordPress container can see it, runs composer install for any composer.json found, installs git hooks, and indexes the code.

Options:

  • --type=theme|plugin|wp-content|none — override the auto-detected mount type
  • --mount-name=<name> — override the directory name under wp-content/themes or wp-content/plugins (default: repo name)
  • --skip-mount — same as --type=none (clone without mounting)
  • --skip-composer — skip the composer install scan
  • --skip-restart — do not restart the WordPress container afterward

If --type is omitted, WDG auto-detects the repo type (theme, plugin, wp-content, or full WordPress install). A full install is mounted as wp-content. If detection fails, nothing is mounted and you are prompted to re-run with an explicit --type.

Examples:

bash
# Add a plugin (default branch)
wdg my-site repo add https://github.com/client/custom-plugin

# Add a specific branch
wdg my-site repo add https://github.com/client/theme develop

# Add over SSH
wdg my-site repo add git@github.com:client/plugin.git

# Force a mount type and directory name
wdg my-site repo add https://github.com/client/theme --type=theme --mount-name=client-theme

# Clone without mounting or restarting
wdg my-site repo add https://github.com/client/lib --skip-mount --skip-restart

List Repositories

bash
wdg <project> repo list

Shows each repository in the project with its current branch and whether it has uncommitted changes.

Repository Status

bash
wdg <project> repo status

Shows git status -sb for every repository in the project.

Sync (Pull) Repositories

bash
# Sync all repositories in the project
wdg <project> repo sync

# Sync a single repository
wdg <project> repo sync <repo-name>

Runs git pull in each repository. Reports a failure (non-zero exit) if any pull fails.

Examples:

bash
wdg my-site repo sync
wdg my-site repo sync wikit-core

Initialize a Repository

bash
wdg <project> repo init <repo-name>

Initializes an existing project directory as a git repository: runs git init, scaffolds a .gitignore and README.md if missing, creates an initial commit, and installs git hooks. The directory must already exist under the project's repositories/.

bash
wdg my-site repo init my-site-theme

Install Git Hooks

bash
wdg <project> repo hooks <repo-name>

(Re)installs the platform git hooks in a repository. The hooks trigger automatic re-indexing on commit and merge.

bash
wdg my-site repo hooks my-site-theme

Attach an External Repository

bash
wdg <project> repo attach <path> [--type=<type>]

Mounts a repository that lives outside the project's repositories/ directory into the project's WordPress container, without copying it. Useful for working on a repo checked out elsewhere on disk.

Mount types (--type, default wp-content):

TypeMount Point
wp-content/var/www/html/wp-content
theme/var/www/html/wp-content/themes/<name>
plugin/var/www/html/wp-content/plugins/<name>

Attaching also generates a docker-compose.override.yml that mounts the Wikit framework plugins/theme alongside the attached repo, installs git hooks if the path is a git repo, and restarts the project if it is running.

Examples:

bash
wdg my-site repo attach /path/to/repo --type=wp-content
wdg my-site repo attach /path/to/plugin --type=plugin
wdg my-site repo attach ../shared-theme --type=theme

Remove a Repository

bash
wdg <project> repo remove <repo-name>

Deletes the repository from the project, regenerates docker-compose.override.yml so its mount disappears, and restarts the WordPress container if it is running.

bash
wdg my-site repo remove custom-plugin

Common Workflows

Add a client plugin and start working

bash
wdg my-site repo add https://github.com/client/custom-plugin --type=plugin
wdg my-site dev

Keep all project repos up to date

bash
wdg my-site repo sync
wdg my-site repo status

Promote a local directory to a tracked repo

bash
wdg my-site repo init my-site-theme
wdg my-site repo hooks my-site-theme

See Also: