I have been using @wordpress/env for a few weeks, starting it with npm run wp-env start
. Since this morning, that now fails with:
> wp-env "start"
✖ error: Your local changes to the following files would be overwritten by checkout:
wp-content/themes/twentytwentyone/assets/css/ie.css
wp-content/themes/twentytwentyone/assets/sass/01-settings/file-header.scss
wp-content/themes/twentytwentyone/style-rtl.css
wp-content/themes/twentytwentyone/style.css
Please commit your changes or stash them before you switch branches.
Aborting
GitError: error: Your local changes to the following files would be overwritten by checkout:
wp-content/themes/twentytwentyone/assets/css/ie.css
wp-content/themes/twentytwentyone/assets/sass/01-settings/file-header.scss
wp-content/themes/twentytwentyone/style-rtl.css
wp-content/themes/twentytwentyone/style.css
Please commit your changes or stash them before you switch branches.
Aborting
at Object.action (/home/alice/wp-demo-theme/node_modules/simple-git/dist/cjs/index.js:1228:25)
at PluginStore.exec (/home/alice/wp-demo-theme/node_modules/simple-git/dist/cjs/index.js:1263:29)
at /home/alice/wp-demo-theme/node_modules/simple-git/dist/cjs/index.js:1627:43
at new Promise (<anonymous>)
at GitExecutorChain.handleTaskData (/home/alice/wp-demo-theme/node_modules/simple-git/dist/cjs/index.js:1625:16)
at GitExecutorChain.<anonymous> (/home/alice/wp-demo-theme/node_modules/simple-git/dist/cjs/index.js:1609:44)
at Generator.next (<anonymous>)
at fulfilled (/home/alice/wp-demo-theme/node_modules/simple-git/dist/cjs/index.js:55:24) {
task: {
commands: [ 'checkout', '6.1.1' ],
format: 'utf-8',
parser: [Function: parser]
}
}
The error message talks about "your local changes", but I have not modified any files in the twentytwentyone theme folder. wp-env
seems to have brought this on itself.
I have tried removing the Docker image for WordPress and starting again, but the problem persists. I have tried wp-env start --update
- that does not fix it either. The Docker container does not stay up so I cannot get into it (with docker exec) to remove those changes.
Any idea how I can get wp-env
working again?