About This Manual

This guide tells you how to use the Perforce Command-Line Client (p4). If you're new to version management systems, you don't know basic Perforce concepts, or you've never used Perforce before, read Introducing Perforce before reading this guide. This guide assumes a good basic understanding of version control.

Command line versus GUIs

Perforce provides many applications that enable you to manage your files, including the Perforce Command-Line Client, GUIs such as P4V, and plug-ins. The Perforce Command-Line Client enables you to script and to perform administrative tasks that are not supported by Perforce GUIs.

Getting started with Perforce

If this is your first time working with Perforce, here's how to get started:

  1. Read Introducing Perforce to learn the basics.

    At a minimum, learn the following concepts: changelist, depot, client workspace, sync, and submit. For short definitions, refer to the glossary at the back of this guide.

  2. Ask your Perforce administrator for the host and port for your Perforce service.

    If you intend to experiment with Perforce and don't want to risk damaging your production depot, ask the Perforce administrator to start another service for test purposes. For details about installing the Perforce service, refer to the Perforce Server Administrator's Guide: Fundamentals.

  3. Use this guide to help you install the Perforce Command-Line Client and configure your client workspace, unless your system administrator has already configured your machine. See “Configuring P4”, for details.

  4. Learn to perform the following tasks:

    • sync (transfer selected files from the repository to your computer)

    • submit (transfer changed files from your workspace to the repository)

    • revert (discard changes)

    See “Managing Files and Changelists”, for details.

  5. Learn to refine your client view. See Refining workspace views for details.

These basic skills enable you to do much of your daily work. Other tasks involving code base maintenance (streams, branching and labeling) and workflow (jobs) tend to be less frequently done. This guide includes details about performing these tasks using p4 commands.

Perforce documentation

This guide, the P4 Command Reference, and the p4 help command are the primary documentation for the Perforce Command-Line Client. This guide describes the current release. For documentation for older releases, refer to the Perforce web site.

For documentation on other Perforce applications, see the documentation web page at http://www.perforce.com.

For specific information about…

See this documentation

The basics of Perforce.

Introducing Perforce

Installing and administering the Perforce service, including user management, security settings and configuring distributed environments that include proxies, replicas, and edge servers.

Perforce Server Administrator's Guide: Fundamentals and Perforce Server Administrator's Guide: Multi-site Deployment

p4 command line flags and options (reference).

P4 Command Reference, p4 help

P4V, the cross-platform Perforce Visual Client.

P4V User's Guide, P4V online help

Working offline with the Perforce Sandbox.

Perforce Sandbox User's Guide

Perforce plug-ins and integrations.

IDEs: Using IDE Plug-ins

Defect trackers: Defect Tracking Gateway Guide

Others: online help from the Perforce menu or web site

Developing custom Perforce applications using the Perforce C/C++ API.

C/C++ API User's Guide

Working with Perforce in Ruby, Perl, Python, and PHP.

APIs for Scripting

Please give us feedback

We are interested in receiving opinions on this guide from our users. In particular, we'd like to hear from users who have never used Perforce before. Does this guide teach the topic well? Please let us know what you think; we can be reached at .

What's new in this guide for 2015.1

This section provides a list of changes to this guide for the Perforce Server 2015.1 release. For a list of all new functionality and major bug fixes in Perforce Server 2015.1, see the Perforce Server 2015.1 Release Notes.

Additional commands that take a file revision range.

See Revision ranges for updated information on all commands that can take a file revision range.

Locking behavior of files following a failed submit

See Submitting changelists for updated information about locking behavior.

Added information on autoreload for labels

See Using static labels to archive workspace configurations for updated information on storage options and performance.