There are two options for getting help on the Perforce command line.
This is available from the Perforce website in two formats:
Notice that the URLs are not version specific, so you will get the latest version of the particular files.
As shown previously, the HTML version of the help includes a complete list of all Perforce commands. The specific page for each command explains command line flags and cross links to other related commands.
This is fully discussed in the command reference manual, towards the bottom of the table of contents:
Note the crucial variables which define the Perforce server you are communicating with (P4PORT), your username (P4USER), and your current workspace (P4CLIENT).
These will be set automatically if you use the Open Command Window Here option from P4V's right-click menu as discussed previously. Note that P4V itself does not take account of environment variables. Instead, it uses the settings defined by the Connection menu and Edit | Preferences options.
Run the p4 set
command:
C:\work\bruno_jam_main\depot\Jam\MAIN\src>p4 set P4CLIENT=bruno_jam_main P4CONFIG=p4config.txt (set) (config 'noconfig') P4EDITOR=C:\Windows\notepad.exe (set) P4PORT=1666 P4USER=bruno
The output shows us the key environment variables already set up in the command window: P4PORT
(1666
is a port on the local machine), P4USER
, and P4CLIENT
.
The info
command also shows us basic server information:
C:\work\bruno_jam_main\depot\Jam\MAIN\src>p4 info User name: bruno Client name: bruno_jam_main Client host: Robert-Laptop Client root: C:\work\bruno_jam_main Current directory: c:\work\bruno_jam_main\depot\Jam\MAIN\src Peer address: 127.0.0.1:52808 Client address: 127.0.0.1 Server address: Robert-Laptop:1666 Server root: C:\perforce\p4book\ Server date: 2013/08/26 09:42:58 +0100 GMT Daylight Time Server uptime: 155:31:02 Server version: P4D/NTX64/2013.2.BETA/663432 (2013/06/25) Server license: none Case Handling: insensitive
A commonly seen error message for the info
command is:
Perforce client error: Connect to server failed; check $P4PORT. TCP connect to 1248 failed. connect: 127.0.0.1:1248: WSAECONNREFUSED
This suggests that either we have configured the wrong value for P4PORT
, or perhaps that the server is not running, or there is a network issue. Check with your administrator to resolve this.
Help is always available when running at the command line:
C:\work\bruno_jam_main>p4 help Perforce -- the Fast Software Configuration Management System. p4 is Perforce's client tool for the command line. Try: p4 help simple list most common commands p4 help commands list all standard commands p4 help command help on a specific command p4 help administration help on specialized administration topics p4 help charset help on character set translation p4 help configurables list server configuration variables p4 help environment list environment and registry variables p4 help filetypes list supported file types p4 help jobview help on jobview syntax p4 help networkaddress help on network address syntax p4 help revisions help on specifying file revisions p4 help streamintro introduction to streams p4 help usage generic command line arguments p4 help views help on view syntax p4 help legal legal and license information The full user manual is available at http://www.perforce.com/manual.
It is often useful to refer to help on specific commands, a list of which is available:
C:\work\bruno_jam_main>p4 help commands Perforce client commands: add Open a new file to add it to the depot annotate Print file lines along with their revisions attribute Set per-revision attributes on revisions branch Create or edit a branch specification branches Display list of branches change Create or edit a changelist description changes Display list of pending and submitted changelists changelist Create or edit a changelist description changelists Display list of pending and submitted changelists client Create or edit a client specification and its view clients Display list of known clients :