Test multiple WordPress versions with one installation
I write my plugins on trunk, I’m using always the latest version, updated daily. When something breaks, I can ask or open a ticket early enough, so my users don’t get in trouble when they are upgrading to the next WordPress release. But at the same time, I have to make sure that my plugins work with the current release and with minor updates like from 3.8.2 to 3.8.3. I use just one WordPress installation for that. How?
Git to the rescue. There is a mirror for WordPress on GitHub. It is kept in sync with the SVN repository every 15 minutes. Close enough.
Let’s create our local installation from that:
# clone WordPress into the directory 'wp' git clone firstname.lastname@example.org:WordPress/WordPress.git wp cd wp/ # get all the tags git pull --tags
.gitignore .htaccess favicon.ico wp-content/debug.log wp-content/languages wp-content/uploads
We can install WordPress now per browser.
Now we are on the branch
master, the latest development version. Whenever we want to switch to another branch or a specific release (tag) we can do that in our console very fast.
Switch to another branch …
git checkout 3.4-branch
… or to a specific release …
git checkout tags/3.4.2
… test our plugin, and then switch back:
git checkout master
To get the latest changes into our local repository, we just call ever day: