July 29, 2014

A Guide to the Perforce Versioning Engine (P4D) for Subversion Users

Helix Core

Moving from one version control system to another is always a daunting task, but the move from Subversion (SVN) to the Perforce versioning engine (P4D) is surprisingly easy. Of course, there are some new concepts and commands to learn but Perforce makes it easy to mirror your existing workflows, and its higher performance and much more powerful tools will ensure that your overall experience is far superior.

In both Subversion and Perforce users check out a portion of the available projects at a single revision (usually the head), modify the files locally and check the changes back into the central server.

From a user’s perspective, the biggest difference between Subversion and Perforce is in the workflows supported by the two systems.

In Perforce the default workflow is optimized for universal visibility and performance. You first declare your intent to edit before actually editing a file. This contrasts with the Subversion approach of editing files and discovering changes later. The former works better with large file sets where discovery of changed files becomes expensive. It is also very useful for checking out and optionally locking binary files that cannot be merged. However, if you prefer the latter you can configure your Perforce environment easily to work in the edit-first, discover-later workflow that Subversion uses. (See this post by my colleague Matt Attaway for more details).

Alternatively, with Perforce, users can use Git as their client without any of the limitations posed to them by “git svn”. You can clone any part of the Perforce Server as a Git repository, and push and pull commits safe in the knowledge that all your changes will be stored in the Perforce Server and shared with your team members (whether they use Perforce native tools or Git).

I’ve written a guide to help you with the initial steps involved with moving from Subversion to Perforce. It explains the concepts underpinning the Perforce versioning engine, and the basics on getting started. It’s not meant as a replacement for the Perforce documentation; rather it’s more a narrative designed to smooth your transition from Subversion to Perforce.

Happy hacking!