| name | repo-sync |
| description | Keep the Create-Delight Remake checkout current and locally runnable after Git updates. Use when the user asks to pull latest changes, switch to main, rebase on main, merge upstream changes, update a branch, or otherwise run Git operations that may bring in packwiz metadata, packwiz-files payloads, or CDC submodule pointer changes. |
Repo Sync
Workflow
Use this workflow for repository update tasks before reporting completion.
- Ensure local Git hook shims are installed without rewriting existing shims, confirm status, and record the pre-update commit:
./scripts/install-git-hooks.ps1 -IfUnset -Quiet
git status --short --branch
$oldHead = git rev-parse HEAD
When switching to main before pulling, record main before checkout:
$oldHead = git rev-parse main
git checkout main
- Perform the requested Git operation with non-interactive commands, then let the shared helper handle Packwiz runtime sync:
git pull --ff-only origin main
git rebase origin/main
git diff --quiet $oldHead HEAD -- scripts/install-git-hooks.ps1 scripts/.githooks
if ($LASTEXITCODE -eq 1) {
./scripts/install-git-hooks.ps1 -Quiet
}
./scripts/sync-packwiz-assets.ps1 -IfGitChanged -OldRev $oldHead -NewRev HEAD -HookName repo-sync
-IfGitChanged checks mods|resourcepacks|shaderpacks/**/*.pw.toml and packwiz-files/**; it runs the full runtime sync only when needed. Git hooks perform the same check for regular local Git operations, but still run this command here so agent-managed updates have a visible result.
The sync script records the last successful revision in the ignored .cache/packwiz-sync/sync-state.json. This makes the hook and the explicit workflow call idempotent: the second call for the same revision, side, metadata roots, and sync-script version exits without downloading again. Use -Force when repairing a known local runtime mismatch. For slow overseas downloads, set PACKWIZ_PROXY=http://127.0.0.1:7890; the hooks inherit this environment variable.
The installer is idempotent: -IfUnset exits when all four shims already exist and are managed, while a full install only rewrites a shim when its generated content differs. The post-update hook installation only runs when the installer or tracked hooks changed. This makes newly added hooks available immediately, while ordinary repository updates do not rewrite local hook shims.
- If
CDC-mod-src changed or git status reports the submodule modified after update, run:
git submodule update --init --recursive
- Finish with:
git status --short --branch
Report whether packwiz sync was required, whether it succeeded, and whether the final worktree is clean.
Notes
- Runtime JARs are local development payloads and are normally not tracked.
- Do not commit local sync side effects unless they are intentional source changes.
- If sync leaves tracked config changes, inspect them before deciding whether to keep or restore them.