Get CommandVisual Studio
Gets (downloads) either the latest version or a specified version of one or more files or folders from Team Foundation Ser ver to the workspace. Although the get command provides a different user interface than Visual Studio (see Download (Get) files from th e Server), the process is fundamentally the same.
Requirements:see Team Foundation Server Permissions.
TF get [itemspec] [/VERSION:VERSIONSPEC] [/all] [/overwrite] [/force] [/remap][/recursive] [/preview] [/noautoresolve] [ /noprompt][/login:username,[password]]
Parameters
|
Parameter |
Description |
|
/all |
If you use a local workspace (recommended) and then it's unlikely you'll have the use of this option.
You can use the this option to the restore an item, the accidentally deleted from a server workspace.
Your Team Foundation Server maintains a internal record of all the items the workspace contains, including the version of each. By default while you get files, if the internal record is on the server indicates the workspace already have the version you a Re getting, then it does not retrieve the item. This option gets the items regardless of the data contained in this internal record. |
|
/force |
Combines /all and /overwrite. |
|
Itemspec |
Specifies the scope of the items to get. You can specify more than one itemspec argument. If no itemspec is provided, the system recursively gets all items in the current workspace.
For syntax, see Team Foundation Version Control Command Reference. |
|
/login:username,[password] |
Specifies the user account to run the command. See Team Foundation Version Control Command Reference. |
|
/noautoresolve |
By default, the system automatically attempts to AutoResolve all (see Resolve File Conflicts). Specify this option to disable this default behavior. |
|
/noprompt |
Suppresses the display of Windows and dialog boxes and redirects output data to the command prompt. See Team Foundation Version Control Command Reference. |
|
/overwrite |
If you use a local workspace (recommended) and then it's unlikely you'll have the use of this option.
By default, the system does isn't retrieve an item if it's writable (that's, if its read-only attribute are cleared) on the Client machine. This option overrides the default behavior and overwrites a writable item, unless the item was checked out. |
|
/preview |
Displays what would occur, without actually performing the Get operation. |
|
/recursive |
Recursively gets items in the specified directory and any subdirectories. If you don't specify an itemspec, then this option is implied. |
|
/remap |
See Phkelley ' s BLOG:TF get/remap. |
|
/version:versionspec |
Specifies the maximum version, or the minimum and the maximum versions, to display in the history data. The default is /version:t (the latest version).
For syntax, see Team Foundation Version Control Command Reference. |
Examples
In all the following examples, assume this $/siteapp/main/is mapped to c:\code\SiteApp\Main\ in the workspace.
Get The latest version of all items in a workspace
C:\CODE\SITEAPP\MAIN\SOLUTIONA>TF get
Gets the latest versions of all items in the workspace. For example, the above command would recursively get all files in $/siteapp/main/including all it child folders.
recursively get the latest version of items of a certain type in a folder
C:\CODE\SITEAPP\MAIN\SOLUTIONA\PROJECT1>TF Get *.cs/recursive
Gets the latest version of all C # (. cs) files in C:\code\SiteApp\Main\SolutionA\Project1.
Get The latest version of a file
C:\CODE\SITEAPP\MAIN\SOLUTIONA\PROJECT1>TF Get Program.cs
Gets the latest version of Program.cs in Project1.
Get A specific version of a file
C:\CODE\SITEAPP\MAIN\SOLUTIONA\PROJECT1>TF Get Program.cs;8
Gets version 8 of Program.cs in Project1.
Get The latest version of the files
C:\CODE\SITEAPP\MAIN\SOLUTIONA\PROJECT1>TF Get File1.cs File2.cs
Gets the latest version of File1.cs and File2.cs in Project1.
Synchronize a workspace to match a version of the team ' s codebase
C:\CODE\SITEAPP\MAIN>TF get/v:15
Synchronizes the workspace to match the codebase as it existed when changeset is created:
-
The name and content of every item in the workspace are changed to match the state it's in on the server.
-
Items that were deleted after that changeset is restored to the workspace.
-
Items that were added after that changeset is deleted from the workspace.
Synchronize a workspace to match a labeled version of the team ' s codebase
C:\CODE\SITEAPP\MAIN>TF Get/v:llastknowngood
Synchronizes the workspace to match the items in the codebase is labeled LastKnownGood:
-
The name and content of every labeled item in the workspace are changed to match the state it's in on the server.
-
Labeled items that were deleted is restored to the workspace.
-
Items that is not labeled on the server is deleted from the workspace.
Work in Visual Studio
Tips
-
If you are beginning a new task, it's probably a good idea for your to run TF get (you can do that from any directory in Your workspace) to download the latest files from the server before your check out files and begin your work.
-
As needed, this command creates folders on disk to contain the child items and the command is downloading.
-
You can view information on the history of a item using the History command and the Changeset command.
-
If you is concerned about-changes might occur to the files in the workspace, you can use the /preview optio N to see the changes, that would occur without actually implementing them.
-
Conflicts could block your get. A Typical cause of conflicts is trying to get the item on which you have pending changes. You can use the Resolve Command to Resolve these conflicts.
[TFS Tutorial] Tfs:get Command