Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / .NET

Easy Perforce Setup

0.00/5 (No votes)
31 Oct 2011CPOL2 min read 6.9K  
I hope this makes your Perforce setup experience smoother!

After trying out many source code control systems, I personally found Perforce to be the easiest to set up and maintain. Before settling on Perforce, I tried Mercurial, Subversion, CVS and Microsoft Team Foundation Server (it was so darn complicated that I gave up on it). So here I am sharing these tips / experiences with you to make your Perforce set up experience easier. But before I begin, I must mention that I am not a Unix person, but here are common problems I found with these SCC:

  • What to use? – There are so many client and server editions that I don’t know which one to download! On top of that, everyone seems to have their own distinct favorite making it hard to choose.
  • Hard to install and configure - If you are lucky to get one of these installed, you need additional degree to learn how to configure them up. Mercurial was relatively easy to set up but it was not intuitive for me to add files to the depot.
  • Limited (or lack of free) integration with tools – I use Visual Studio for my development and it is a must for me to use a SCC that integrates with Visual Studio. No command line or shell support is not good enough.

I found Perforce easy to set up and configure. It is also flexible to store depot files and version database at flexible locations. You can configure P4ROOT system variable to indicate to Perforce where you want it to store the version database (make sure you restart perforce service after setting P4ROOT). To specify where Perforce should store files in depot, type p4 depot <depot_name> where depot_name is the name of your depot (default is “depot”). This will bring up the Notepad configuration for depot where you can specify the depot location in the Map: section (you can also use absolute paths but any path relative or absolute must always end with \… so for example D:\Depot\…). I strongly suggest having P4Root same as depot root since it makes it convenient for performing backups. Also, Perforce client P4V is a standard client which integrates with a lot of IDEs including Visual Studio! I hope this makes your Perforce setup experience smoother!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)