Forrest logo
back to the p4 tool

p4:tldr:b7974

p4: Open a new file to add it to the depot.
$ p4 add
try on your machine

The command "p4 add" is used in the Perforce version control system to add new files or directories to the depot.

When you want to include a new file or a new directory in your depot, you need to inform Perforce about it using the "p4 add" command. This command tells Perforce to begin tracking the specified file or directory.

Here's a basic usage example:

p4 add <file or directory>

Perforce will then stage the specified file or directory for submission. It means Perforce will recognize the file or directory as part of your project and start managing its version history.

After adding the file or directory, you can then submit it to the depot using the "p4 submit" command, which saves your changes to the central repository and makes them available to other users in your team.

It's important to note that "p4 add" only stages the files or directories for addition. To actually send your changes to the server, you must follow it up with a "p4 submit" command.

Additionally, after adding a file or directory, you can further modify it, including making changes, renaming, or deleting it before you submit it.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the p4 tool