p4 reconcile

Synopsis

Open files for add, delete, and/or edit in order to reconcile a workspace with changes made outside of Perforce. You might need to use this command after working offline from Perforce.

Syntax

p4 [g-opts] reconcile [-c changelist] [-e -a -d -f -I -l -n -m -w] [file ...]

Description

If the p4 reconcile command finds unopened files in a user's workspace and detects the following three types of inconsistencies between the workspace and the depot, it takes the following actions:

  1. Files present in the depot, present in your have list, but missing from your workspace. By default, these files are then opened for delete.

  2. Files present in your workspace, but missing on the depot. By default, these files are opened for add.

  3. Files modified in your workspace that are not open for edit. By default, these files are opened for edit.

If the p4 reconcile command finds files that are opened for edit but missing from the client, it re-opens them for delete.

If the list of files to be opened includes both adds and deletes, the missing and added files are compared and converted to pairs of move/delete and move/add operations (as long as the files' sizes and contents are similar.)

To limit the scope of p4 reconcile to add, edit, or delete, use the -a, -e, or -d options.

To preview the set of proposed workspace reconciliation actions, use the -n option.

To improve performance when reconciling changes to large files, the -m option can be used under certain conditions.

By default, p4 reconcile does not check files and/or paths mentioned in the P4IGNORE file. Use the -I option to override this behavior and ignore the P4IGNORE file.

Options

-c changelist

Open the files to be reconciled in the specified pending changelist. If you omit this argument, the files are opened in the default changelist.

-e

Edit files: Find files in the workspace that have been modified outside of Perforce, and open them for edit.

-a

Add files: Find files in the workspace that are not under Perforce control and open them for add.

-d

Delete files: Find files missing from the workspace, but present in the depot; open these files for delete, but only if these files are in the user's have list.

-n

Preview the results of the operation without performing any action.

-f

Add filenames that contain special (wildcard) characters. Files containing the special characters @, #, %, or * are reformatted to encode the characters using hex notation. After these files are added, you must refer to them using their reformatted filenames.

-I

Do not perform any ignore checking; ignore any settings specified by P4IGNORE.

-l

Display output in local file syntax with relative paths, similar to the workspace-centric view of p4 status.

-m

Compare the file submit time (in the depot) with the file modification time (in the workspace) to determine whether the file has changed.

Normally Perforce uses file digests to determine whether files in the workspace differ from the head revisions of these files in the depot. This can be time consuming for large files.

You can use the -m option only if the workspace was last synced with the client modtime set or if the files were synced with the +m file type. This option is only relevant if you are using reconcile to find changed files rather than files that were deleted or added.

For more information, see: http://answers.perforce.com/articles/KB_Article/File-Modification-Times

-w

Forces the workspace files to be updated to match their corresponding latest synced versions from the depot. Workspace files that are not in the depot are deleted; files that are modified or deleted in the workspace will be replaced with their corresponding versions in the depot. This operation will result in the loss of any changes made to unopened files.

The use of p4 reconcile with this option is the same as using the p4 clean command. For information on the use of other flags when using p4 reconcile with the -w option, please see the description of the p4 clean command. The same flags can be used with both.

This option requires read permission.

g-opts

See the “Global Options” section.

Usage Notes

Can File Arguments Use Revision Specifier?

Can File Arguments Use Revision Range?

Minimal Access Level Required

No

No

open

  • The p4 reconcile command produces output in depot syntax. To see file names and paths in local syntax, you must either use the -l option with p4 reconcile, or use p4 status.

  • When called without arguments, p4 reconcile opens the files in a changelist. To preview an operation, you must either use the -n option with p4 reconcile, or use the p4 status command.

Related Commands

A shortcut for p4 reconcile -n

p4 status

A shortcut for p4 reconcile -ead

p4 status -A