WordPress.org

Plugin Directory

wiki:VersionControl

Version Control

What is it good for?

Version control is probably the most useful development tool around. It's the reason WordPress is able to coordinate development with people working all over the world. Basically version control saves every single version of a file. Once that information is stored you can do all sorts of useful things with it, like see a line for line different between a file today and the same file two weeks ago.

Version control provides a safety net. You can be sure that no matter what you do, you'll always be able to easily roll back the changes and keep track of exactly what you've changed from day to day. I personally use version control for almost everything in my life, even things that don't change often, just because I like being able to track things.

When working with version controlled files, you usually check out the files to your local playground, then change them around, then commit your changes back to the repository with a short message saying what the changes are. Then Trac and Subversion can create a record and diff of the change, like this.

More Information

There is literally an entire book written on Subversion available completely for free online from O'Reilly. If that's a bit overwhelming, there's also a cheat sheet available.

Getting Started

On Windows

We recommend the excellent TortoiseSVN program which integrates with your shell and allows you to easily check out and commit changes to your repository.

On Mac OS X

You can use the command line instructions below or the SC Plugin which gives context menu integration similar to Tortoise SVN.

Via Command Line (Linux, BSD, etc)

If you have the Subversion client installed you can interact with the repository like so:

svn co http://svn.wp-plugins.org/your-plugin/
cd your-plugin/
cp /path/to/your/plugin-file.php trunk/
svn add trunk/plugin-file.php
svn ci trunk/plugin-file.php

Later after you make changes, check in your new version with something like:

svn ci trunk/plugin-file.php

You can interact with the Subversion repository using the command line client "svn" but there are also more graphical ways to manage things, notably for Windows and for Macs.

Last modified 8 years ago Last modified on 04/06/06 22:18:28