VVV is a local development environment powered by virtual machines. In other words, it is a self-contained local development environment aimed at WordPress developers. It can be used to build sites and contribute to the development of WordPress Core.
If you’re running a WordCamp Contributor Day, you should use the contributor day set up script to bundle a pre-configured VVV instance (including instructions) that can be copied onto USB sticks and given to attendees. Setting up a local environment over conference Wi-Fi can cause problems for all. The setup script generates a pre-built version of VVV that greatly reduces the amount of data that attendees need to download.
Click for information about the VVV contributor day USB drive generator
During Contributor Days there might be USB sticks available containing the latest version of VVV which is already configured for use. This means that you won’t need to download the packages over Wi-Fi. However, you will still need to download some items and should follow the instructions provided in the files on the USB stick to get set up.
If you don’t have a Contributor Day USB stick available, follow the official installation instructions on the VVV site.
VVV also includes the following two environments:
- http://trunk.wordpress.test/ An SVN-based WordPress core trunk setup, useful for Contributor Days, Trac tickets, patches, general core contributing, etc.
- http://wp-meta.test A collection of sites for contributing to WordPress.org
These two sites are disabled by default if you are installing VVV without the script on Contributor Day USB sticks.
To enable these environments, check if you have a config/config.yml
file in your VVV folder. If you don't have a config.yml
file, then run vagrant status
and it will be created for you. In config.yml
, look for the wordpress-trunk
and wordpress-meta-environment
and change skip_provisioning: true
to skip_provisioning: false
and save. Finally, run vagrant up --provision
to apply the change. This will take some time to run, especially if you have enabled the Meta environment.
For example to enable the trunk site, find this:
wordpress-trunk:
skip_provisioning: true # provisioning this one takes longer, so it's disabled by default
and change it to this:
wordpress-trunk:
skip_provisioning: false # provisioning this one takes longer, so it's disabled by default
Then save, and reprovision with the vagrant up --provision
command.
For more detailed guide on enabling these environments, refer to this guide.
- When you start VVV it will continue to run untill it's stopped or your machine shutsdown. To save your battery life you should get into the habit of shutting down the environment when you don’t need it. To do this, navigate to the directory where you installed VVV and run command
vagrant halt
. You can start the VM up again by running commandvagrant up
from the same directory. - WordPress Core uses SVN, so you may need to familiarise yourself with its commands if you plan on testing or writing patches. You can find out how to work with patches here in the Core handbook.
- You can run
vagrant ssh
to get inside VVV where you will find an Ubuntu Linux install with common tools such assvn
,git
, etc
If you want to create patches for WordPress, you don’t want to use SVN. If you want to use a version control system though, Git is a good alternative. Pull requests on GitHub can provide a convenient way to receive feedback on your work and to share the patch for your contributions.
Tip: You can add ‘.diff’ to the end of any pull request URL and GitHub will return a diff file that you can then attach to a Trac ticket. Alternatively, you can add a link to the pull request in a Trac ticket comment.
To create a GitHub repo:
- Make sure VVV is set up (see instructions above).
- Swap out your SVN repo with a Git one in VVV by running the following command:
vagrant ssh -c /srv/www/wordpress-trunk/bin/develop_git
- Fork the https://github.com/wordpress/wordpress-develop repo on GitHub.
- Run the following commands to set this new repo as your origin remote:
cd ...vvv/www/wordpress-trunk/public_html && git remote set-url origin https://github.com/YOURNAME/wordpress-develop.git
- Check out the master branch:
git checkout master
- Create a feature branch based on the Trac ticket you want to work on (e.g. 12345):
git checkout -b trac-12345
- Add commits for your fixes and run command
git push
. - Go to GitHub and open a pull request to your
master
branch. - Copy the URL to your newly-created pull request, and paste it into a new comment on WordPress Trac and ask for feedback.
Learn how to set up more sites on VVV.
Core Handbook - tutorial on installing a local server.
Core Handbook - how to submit Github Pull Request to WordPress Core