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.

p4 rec is a synonym for p4 reconcile.

Syntax

p4 [g-opts] reconcile [-c changelist] [-a -d -e -f -I -k -l -m -n -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.
  4. Files opened for delete and present in your workspace that don’t have pending resolve records are reopened 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.

Use the -k option to update the have list if files are mapped in a client’s workspace to files in the depot that are not on the have list.

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

-a

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

-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.

-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.

-e

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

-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.

-k

Update the have list if files are mapped in a client’s workspace to files in the depot that are not on the have list.

-l

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

-m

Compare the file sync or submit time (in the depot) with the file modification time (in the workspace) to help 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. But when the timestamps are the same when this option is used, the costly digest comparisons can be skipped.

This option is only relevant if you are using reconcile to find changed files rather than files that were deleted or added.

-n

Preview the results of the operation without performing any action.

-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 options when using p4 reconcile with the -w option, see the p4 clean command. The same options can be used with both.

This option requires read permission.

g-opts

See “Global Options”.

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