Reconcile command (Team Foundation Version Control)

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019

Visual Studio 2019 | Visual Studio 2022

The Team Foundation Version Control (TFVC) tf reconcile command compares the current state of the workspace on disk with the server's view, either to clean the workspace or to promote unpended local changes.

Prerequisites

See Default TFVC permissions.

Syntax

tf reconcile [itemspec]
/clean [/diff] [/noprompt] [/preview] [/recursive] [/ignore]
[/unmapped] [/exclude:itemspec1,itemspec2,...] 

tf reconcile [itemspec]
/promote [/adds] [/deletes] [/diff] [/noprompt] [/preview]
[/recursive] [/noignore] [/exclude:itemspec1,itemspec2,...]

Parameters

Arguments

Argument

Description

<itemspec>

Identifies the file or folder for which to apply the reconcile command. If omitted, all suitable items are included. For more information about how TFVC parses an itemspec to determine which items are within scope, see Use Team Foundation version control commands.

Note

You can specify more than one itemspec argument.

Options

Option

Description

/clean

Updates local items on disk to match the server's structure. Removes items that aren't present in version control, and adds items that are missing on disk but present in version control.

/promote

Promotes local file changes to version control. Adds locally created items to version control, similar to tf add, and removes locally deleted items.

Note

Specify /adds and/or /deletes when using with /noprompt.

/adds

Promotes locally added files and folders to version control.

Note

Can use with /promote only.

/deletes

Promotes deleted files and folders to version control.

Note

Can use with /promote only.

/exclude

Ignores comma-separated items specified in this option.

Note

This option overrides /ignore, /noignore, and /unmapped options in case of intersections.

/unmapped

Overrides the default, and cleans unmapped and cloaked items. By default, unmapped and cloaked items aren't affected by the /clean command. For more information, see Mappings (workspace).

Note

Can use with /clean only.

/diff

Compares items with source control by using MD5 hashes. Use this option to detect items that are different from the workspace version but still have their read-only bit set (+R).

/preview

Displays what would occur, without actually doing the reconcile operation.

/ignore

Overrides the default and doesn't change ignored items. By default, /clean updates all items based on the current server state, including items ignored by version control. Use this option to avoid changing the ignored items.

You can configure which items are ignored using a .tfignore file. For more information, see Customize which files version control ignores.

Note

Can use with /clean only.

/noignore

Overrides the default, and promotes ignored items. By default, /promote promotes all items except items that are ignored by version control. Use this option to promote the ignored items as well. This option is similar to using /noignore in the tf add command.

Note

Can use with /promote only.

/recursive

Reconciles items in the specific directory and subdirectories.

/noprompt

Suppresses the display of windows and dialog boxes and redirects output data to the command prompt. See Use Team Foundation version control commands.

Remarks

You can use the reconcile command to synchronize your local workspace state with the server's state.

  • Use /clean to update the local workspace according to the server's state.
  • Use /promote to promote locally added and deleted items to pending changes in version control.

For more information on how to use the tf command-line utility, see Use Team Foundation version control commands.

Examples

Clean

The following example opens the Visual Studio Clean Workspace dialog box, so that you can specify local items that should be deleted or re-downloaded from the server.

tf reconcile /clean

The following example cleans all local items except items that are ignored by version control.

tf reconcile /clean /ignore

The following example cleans all local items, including unmapped and cloaked items.

tf reconcile /clean /unmapped

The following example cleans all items except file1.txt and dir1 with all its contents, and doesn't display the Clean Workspace dialog box.

tf reconcile /clean /noprompt /recursive /exclude:file1.txt,dir1

Promote

The following example opens the Visual Studio Promote Candidate Changes dialog box, so that you can specify what items should be promoted to pending changes.

tf reconcile /promote

The following example promotes all items, including items ignored by version control, except for the myLib.dll file.

tf reconcile /promote /noignore /exclude:myLib.dll

The following example adds all locally created items to version control pending changes, without opening the Promote Candidate Changes dialog box. This command is similar to the tf add /noprompt command.

tf reconcile /promote /adds /noprompt

The following example adds all locally deleted items to version control pending changes, without opening the Promote Candidate Changes dialog box.

tf reconcile /promote /deletes /noprompt