Thursday, June 26, 2008

Beginning Perforce

  • What is Perforce?
Perforce means "By necessity; by force of circumstance". Now every software organization necessarily need a Source control tool, perforce is one among them. Perforce provides a force to manage the source code efficiently and effectively.

  • Want to play with Perforce? Download
Download a free 2 user Perforce server from http://www.perforce.com/perforce/loadprog.html. To play around, a Perforce server "p4d" and a Perforce client "p4" is required on Unix platforms or you can download p4win for windows, which is GUI based includes P4, P4D and P4P.
P4P is perforce proxy. P4V is mainly used as GUI client in UNIX machines, but it can also be used in Windows.
  • How to start a Perforce Server?
In Unix:
mkdir $HOME/p4bin. Put P4, P4d and P4V to here and add this directory to your path
mkdir $HOME/p4server
mkdir $HOME/p4workspace
Make the programs in $HOME/p4bin executable

Starting the Perforce server:
p4d -d -p 1666 -r $HOME/p4server
where -d suggests to run server as daemon
-p tells port number
-r set server root directory

In Windows:
Install p4win
Start Perforce server p4d.exe as
./p4d.exe -d -q -p 1777 -r . -L ./log &
where -q suggests quiet (suppress start up messages)
-L sets error Log

  • Terminologies used in Perforce
Depot: Repository for source files and Metadata.
Client: Your private workspace to download files from Depot and to play with it
Sync: Get code from depot to client
Edit: Check out
Submit: Check in

  • Creating a Perforce client
Perforce client is your own private work space to sync the depot code