Git Integration
When your themes or plugins live in git repositories, Rudel integrates with git automatically. Instead of treating every sandbox as a dead-end file copy, it can create a dedicated rudel/{sandbox-id} branch and attach worktree metadata to the environment. Those worktrees live inside the environment's own cloned wp-content, so git-aware code workflows still respect the same isolation boundary as the rest of the environment.
How it works
When you create a sandbox with --clone-themes or --clone-plugins, Rudel checks each copied theme or plugin directory for a .git folder. If it finds one, it creates a worktree on a new branch named rudel/{sandbox-id} inside that sandbox's local wp-content and records that relationship in Rudel's runtime tables. Directories without git are copied normally, and uploads are always copied since they are runtime data rather than version-controlled source.
wp rudel create --name=feature-x --clone-themes --clone-pluginsIf your theme at wp-content/themes/my-theme is a git repo, the sandbox keeps using that theme as tracked code inside its own local wp-content, and Rudel records the generated sandbox branch plus the tracked directory metadata in runtime tables.
Working in the sandbox
From the sandbox's tracked theme or plugin directory inside that environment, you're on a regular git branch. You can commit and push just like any other feature branch.
cd /path/to/the/theme-or-plugin-directory-rudel-tracked-for-the-sandbox
git status
git add .
git commit -m "Add new template"
git push origin rudel/feature-x-a1b2AI coding agents working in the sandbox can commit their changes directly from the tracked theme or plugin checkout inside that environment.
Merging and cleanup
Once the branch is merged into main, the sandbox has served its purpose. Instead of manually destroying it, run:
wp rudel cleanup --mergedThis checks every sandbox that carries tracked Git branch state. If all of a sandbox's tracked branches have been merged into their base branch, the sandbox is destroyed and Rudel cleans up the branch metadata along with the environment.
To preview what would be removed without actually deleting:
wp rudel cleanup --merged --dry-runWhat gets git-tracked
Only themes and plugins are eligible for git worktrees. The decision is per-directory: if a copied theme or plugin contains a .git directory, Rudel can track it as git-backed code inside the environment-local wp-content. Directories without git are copied normally. Uploads are always file-copied.
One opt-in constraint matters here: if an environment uses shared_plugins, plugin directories are live-linked to the host and are therefore not valid Rudel-owned Git worktree targets. Theme-tracked Git workflows are unaffected.
The site data side of the sandbox is not part of git. That is the disposable part. The code changes in themes and plugins are the part that should be preserved, and git already handles that naturally.
Built-in Git remote support
Rudel now uses a PHP-native Git engine for clone, push, fetch, merge checks, and worktree lifecycle. That means you can keep using Git-backed code workflows on hosts where the git binary is not installed.
Use any normal remote URL Rudel can reach:
wp rudel create --git=https://example.test/my-theme.git
wp rudel push my-sandbox-a1b2 --git=https://example.test/my-theme.git --dir=themes/my-theme --message="Add header template"Rudel creates the branch (rudel/{sandbox-id}), keeps the tracked checkout inside the environment-local wp-content, and pushes the resulting commit through its built-in Git layer.
Apps can also carry one tracked Git remote, branch, and directory:
wp rudel app create --name=demo --domain=demo.example.test --git=https://example.test/demo-theme.git --branch=main --dir=themes/demo-themeAny sandbox created from that app inherits the tracked Git metadata automatically. That keeps branch and merge-cleanup workflows consistent across the app lifecycle without making operators restate the same remote details on every derived sandbox.
Without git
If none of your themes or plugins are git repos and you do not use tracked Git remotes, Rudel simply copies the relevant code directories and keeps the environment lifecycle running normally. Git integration is an optional code-management layer on top of the multisite runtime.