Team Services | TFS 2015 | Visual Studio 2015 | Visual Studio 2013
Use the folderdiff command to display and compare a visual representation of the differences between files in two server folders, in a server folder and a local folder, or in two local folders.
To use the folderdiff command, you must have the Read permission set to Allow. For more information, see Team Foundation Server Permissions.
tf folderdiff [sourcePath] targetPath [/recursive] [/noprompt] [/collection:TeamProjectCollectionUrl] [/filter:filter] [/filterLocalPathsOnly] [/login:username,[password]] [/view:same,different,sourceOnly,targetOnly]
The local or server path that is the source path in the compare operation. If this argument is not supplied and targetPath is the local mapped path, sourcePath is the server path that is mapped to it.
The local or server path that is the target path in the compare operation.
Specifies a semicolon delimited list of inclusion and exclusion filter masks for the /filter option. Default is "*" (include all). The Remarks section in this topic includes a detailed description of filters and masks.
The URL of the team project collection that contains the files for which you want to display and compare the differences (for example, http://myserver:8080/tfs/DefaultCollection).
Provides a value to the /login option. You can specify a username value as either DOMAIN<i>UserName or UserName.
Optional. Specifies that the two folders are fully compared recursively.
Optional. tf folderdiff runs without displaying user interface. The output is displayed in the Command Prompt window instead.
Optional. Specifies a list of inclusion and filter masks that are used to match the names of files and folders to be compared.
Optional. Specifies that only the local paths will be filtered, unless the corresponding server path exists.
Optional. Specifies what information is included in the output using a comma separated list of the following values:
same—output displays files with the same content in both source and target directories.
different—output displays files with different content in both source and target directories.
sourceOnly—output displays files that exist only in source directory.
targetOnly—output displays files that exist only in target directory.
The default is "different,sourceOnly,targetOnly"
Specifies the team project collection.
Specifies the user name and password to authenticate the user with Visual Studio Team Foundation Server.
The Command Prompt window displays the output if you specify /noprompt. Otherwise, the Folder Difference window displays the output. When the system compares the local mapped folder to the server folder to which it is mapped, the output in the Folder Difference window includes a list of pending changes. Also, the output in the Folder Difference window tells you whether the local folder contains the latest copy or not.
The output displayed in the Command Prompt window lists all the files in the folders in the following five sections:
Items that exist only in the server folder.
Items that exist only in the local folder.
Items that have different contents.
Items that have identical contents (you must specify the same argument with the /view option).
File and Folder Filters
A filter is an ordered list of name masks used to match the name of files and folders to be compared. Each mask can contain the wildcard characters question mark (?) and asterisk (*). '?' matches exactly one character and '*' matches zero or more characters. The masks in a filter are delimited by semicolons (;). Folder masks must end in backslash (\). To specify an exclusion mask, prefix the mask with an exclamation mark (!).
The filter is applied to the file and folder names using the following rules:
When both file and folder masks are specified together in a filter, the file masks are separated into a file mask list and the folder masks are separated into the folder mask list. File masks are applied only to file names. Folder masks are applied only to folder names.
When the command matches a file or folder name, it compares the name to each mask in the filter in the order it was specified. As soon as the name matches a mask, the name is considered to be a match.
If the file masks in the filter contain an inclusion mask, files that do not match any of the file masks are excluded.
If the file masks in the filter contain only exclusion masks, files that do not match any of the file masks are included.
If the folder masks in the filter contain an inclusion mask, folders that do not match any of the folder masks are excluded.
If the folder masks in the filter contain only exclusion masks, folders that do not match any of the folder masks are included.
These are some examples of filter masks:
Matches all C# files.
Matches all bitmap files that begin with "My."
Excludes all executable files.
Excludes all objd directories.
These are some examples of filters:
Matches all C# files, and excludes objd, obj, and bin directories
Excludes all resx and ini files as well as the folders "resources" or folders that have "junk" in the name
For more information on how to find the tf command-line utility, see Tf Command-Line Utility Commands.
The following example compares the files in the server folder and a local folder. It organizes the files in the localFolder recursively and displays the output in the Command Prompt window.
C:>tf folderdiff $/serverFolder F:\localFolder /recursive /noprompt