Chapter 2. Working with Files

In this chapter, we’ll survey the Perforce commands you’re most likely to use for basic software development. We’ll discuss creating and managing a workspace, working on files , and finding out who did what when. If you’re already using Perforce, this chapter will be a review. You can skim through it—maybe you’ll find something here you didn’t know about—or skip it now and come back to it later if you care to.

If you’re new to Perforce, this chapter will introduce you to a variety of useful commands. What’s more, this chapter will serve as a quick reference to many common tasks. There’s more to each of the commands introduced here, of course. You’ll find the complete inventory of commands and command options in the P4 Command Reference.

You may wish to experiment with these commands as you read along. See Appendix A if you don’t already have Perforce installed.

Whether you’re a Perforce user or not, you’ll need at least a glancing familiarity with the basic commands described in this chapter so that you can make sense of them as they appear throughout the book.

An Overview

In Perforce, working on files involves setting up and synchronizing a workspace, adding and working on files, resolving parallel changes (if necessary), and submitting changes to the depot:

Setting up a workspace

The first thing you do before you can work on files is define a client workspace for yourself. A client workspace specification, ...

Get Practical Perforce now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.