Update a development wiki
Releasev0.35.0 · cfeceb67
This workflow updates a configured MediaWiki checkout, reviews the source changes, then updates dependencies and database schemas. First set up a wiki and select the development context you want to update. Review or back up any development data you need before running schema changes.
For update modes, skipped repositories, saved changes, and failure behavior,
read mw dev mediawiki update-code --help.
Preview and update the source
Section titled “Preview and update the source”Preview which checkouts are eligible without fetching or changing them:
mw dev mediawiki update-code --dry-runCheck the reported branches and skipped repositories. Then fast-forward eligible clean checkouts:
mw dev mediawiki update-codeFor uncommitted work you want reapplied after updating, use this instead:
mw dev mediawiki update-code --mode=stashReview the results before continuing. In the core checkout and any extensions or skins you changed, inspect the working tree and recent commits:
git status --shortgit log -5 --onelinegit diffgit diff --cachedSource updates are independent: an error does not undo repositories that already updated. Resolve failures and review skipped repositories before updating shared dependencies or running maintenance.
Update dependencies and schemas
Section titled “Update dependencies and schemas”With the environment running, update PHP dependencies after reviewing the source changes:
mw dev mediawiki composer update --no-interactionAlternatively, mw dev mediawiki update-code --composer combines source and
Composer updates, running Composer only when all checkouts succeed with none
skipped. Review its output before proceeding to database maintenance.
Update the configured development wikis:
mw dev mediawiki foreachwiki update.php -- --quickCheck the maintenance output, then open your wiki and verify the features you are developing. Composer and database changes are separate from Git recovery; restoring source refs does not reverse either of them.
Recover saved work after a reset
Section titled “Recover saved work after a reset”If you deliberately want to switch to the remote default branch and leave local changes saved, preview mop mode before using it:
mw dev mediawiki update-code --mode=mop --dry-runmw dev mediawiki update-code --mode=mopIn each affected repository, use the exact refs printed by the command. The following placeholders stand for those printed refs. Inspect the saved work before applying it:
git show --stat <printed-original-ref>git stash show --stat <printed-stash-ref>To preserve the old commit on a named branch:
git branch recovered-work <printed-original-ref>To reapply saved changes to your current checkout, start from a clean worktree and use:
git stash apply --index <printed-stash-ref>Resolve any conflicts and inspect git status and git diff before continuing.
If the CLI reports recovery-needed, inspect the repository and its printed
recovery refs first; do not assume it restored the original state.
Read this guide offline with mw help guides dev update-code.
Page views: —Sessions: —