# Resolving files

Conflicts occur when you attempt to integrate a file into an existing codeline or to submit a changelist containing a file that another user has edited and submitted while you had the file checked out. When the conflict occurs, Perforce schedules the file for resolve. Conflicts must be resolved before the changelist that contains the conflicting file can be successfully submitted.

When you attempt to submit a changelist containing a file that must be resolved, the Submit Changelist form displays instructions and the Submit button is grayed out.

If the dialog says Out of date and there is a yellow triangle badge on any file, get the latest revision of that file by context-clicking it and selecting Get Latest Revision. This will not overwrite the copy of the file that is in your workspace.

Once you have the latest revision, you now need to resolve the file(s). As described below, you can either resolve files individually, or attempt to resolve multiple files at once.

## Resolving individual files

To resolve an individual file: context-click that file and select Resolve.... The Resolve dialog displays the following information:

Files to Resolve
This is the file that needs to be resolved and the version of the file that it needs to be resolved with.

Recommended action
P4V recommends an action, based on the differences and conflicts in the file selected. This recommendation is followed by an explanation.

Resolve options
Click one of these buttons to perform the following action:

- Accept Merged: This replaces the file in your workspace with the merged result of the two files listed in the box at the top of the screen.
- Accept Yours: This accepts the file that is in your workspace, overwriting the version that is in the depot when you submit the file.
- Accept Theirs: This replaces the copy of the file in your workspace with the version that is in the depot, discarding your changes.

Additional options
This section provides access to various tools that can give you more information about the files you are resolving:

- Run Merge Tool: Opens your chosen merge tool. Use this to edit the file and save the merged result if you would rather not accept any of the above resolve options.
- Open File: Pull-down menu that allows you to open either version of the file individually or the merged result file in any editor.
- Diff: Pull-down menu that allows you to diff the files against one another or each file against the merged result. This opens your chosen diff tool.
- File History: Pull-down menu that allows you to view the revision history of either file.
- Time-lapse View: Pull-down menu that allows you to view the history of either file using the Time-lapse View tool.

In order to submit the file, you will need to resolve it using one of the above options, either by clicking one of the Accept buttons to accept any one version of the file or by running the Merge tool to edit and save the file. Once you have resolved the file, you can submit your changelist.

## Resolving multiple files

To resolve multiple files at one time, select the files, then context-click and select Resolve.... The Resolve dialog displays the following information:

Files to Resolve
These are the files that needs to be resolved. As files are resolved, they are removed from this list.

Recommended action
P4V recommends an action, based on the differences and conflicts in the files selected. P4V recommends one of two actions:

- Auto resolve: If there are files that contain no conflicts, P4V recommends that you auto resolve. See below for Auto resolve options.
- Interactive resolve: If files contain conflicts, P4V recommends that you interactively resolve those files individually, as described above.

Resolve options
In this section, select either Auto or Interactive resolve.

- Auto: Click this button to automatically resolve files. Select one of the following options:

- Accept changed file. Only one of the files differs from the base file. Selecting this option will automatically accept the file that differs.
- Merge yours and theirs. If no conflicts exist, P4V creates a merged file from both files.
- Accept yours. Accepts the file that is in your workspace, overwriting the version that is in the depot when you submit the file.
- Accept theirs. Replaces the copy of the file in your workspace with the version that is in the depot, discarding your changes.
- Merge yours and theirs including conflict markers. Creates a merged text file with all changes. Where there are conflicts, both versions are included with text notations indicating the conflicts.

- Interactive
: Click this button to resolve each file individually, as described above.

If you select Auto resolve but there are still conflicts remaining in any of the files, P4V prompts you to interactively resolve each file individually. If all files can be automatically resolved, you can then submit your changelist.