How to keep Wordpress Core in version control?

I want to keep my Wordpress version consistent when I clone my project.
Everytime I clone my project in a new folder, I have to manually update to Wordpress 6.
Which folder do I have to unignore with Git to achieve this? I’ve tried adding web/wp to version control, but this didn’t work.

You won’t want to keep WordPress core in your version control directly. You will not want to add web/wp

Was this about #bedrock? If you were using Bedrock or composer to manage plugins and other dependencies, you would want to update the lock file and the json file for your WordPress dependency.

You should have in your composer.json a roots/wordpress or johnpbloch/wordpress dependency. The version next to it is used to limit the max version it will pull when you do a composer update

To update that to the latest version just run a composer require on the package again like this:

composer require roots/wordpress

That will update it to the latest version of the package, so your composer.json will have
"roots/wordpress": "6.0", in it.

3 Likes

This topic was automatically closed after 42 days. New replies are no longer allowed.