Get Command

Visual Studio 2012
 

Gets (downloads) either the latest version or a specified version of one or more files or folders from Team Foundation Server to the workspace. Although the Get command provides a different user interface than Visual Studio (see Download (get) files from the 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), then it‘s unlikely you will have to use this option.

You can use this option to restore an item that you have accidentally deleted from a server workspace.

Your Team Foundation Server maintains an internal record of all the items the workspace contains, including the version of each. By default, when you get files, if the internal record on the server indicates the workspace already has the version you are 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), then it is unlikely you will have to use this option.

By default, the system does not retrieve an item if it is writable (that is, if its read-only attribute is cleared) on the client machine. This option overrides the default behavior and overwrites a writable item, unless the item is 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 do not 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 that $/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 its 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 two 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 15 was created:

  • The name and content of every item in the workspace is changed to match the state it was in on the server.

  • Items that were deleted after that changeset are restored to the workspace.

  • Items that were added after that changeset are 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 that are labeled LastKnownGood:

  • The name and content of every labeled item in the workspace is changed to match the state it was in on the server.

  • Labeled items that were deleted are restored to the workspace.

  • Items that are not labeled on the server are deleted from the workspace.

Work in Visual Studio

 

Tips

 
  •  If you are beginning a new task, it’s probably a good idea for you to run tf get (you can do so from any directory in your workspace) to download the latest files from the server before you check out files and begin your work.

  •  As needed, this command creates folders on disk to contain the child items that the command is downloading.

  •  You can view information about the history of an item using the History Command and the Changeset Command.

  •  If you are concerned about what changes might occur to the files in the workspace, you can use the /preview option 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 an item on which you have pending changes. You can use the Resolve Command to resolve these conflicts.

[TFS教程]TFS: Get Command的更多相关文章

  1. Team Foundation Server 2015使用教程--tfs用户账号切换

  2. In-Place upgrade to Team Foundation Server (TFS) 2015 from TFS 2013Team Foundation Server TFS TFS 2015 TFS upgrade TFS with Sharepoint

    This upgrade document gives detailed step by step procedure for the In-Place upgrade from TFS 2013 t ...

  3. TFS代码迁移Git

    描述 将TFS上的代码迁移到Git做版本控制. 参考地址 tfs-git下载:https://github.com/git-tfs/git-tfs/releases chocolatey安装:http ...

  4. docker4dotnet #5 使用VSTS/TFS搭建基于容器的持续交付管道

    在过去的几篇d4d系列中,我给大家介绍了如何使用docker来支持asp.net core的应用开发,打包的场景.Asp.net core的跨平台开发能力为.net开发人员提供了使用容器进行应用开发的 ...

  5. TFS API:一、TFS 体系结构和概念

    TFS API:一.TFS  体系结构和概念 TFS是Team Fundation Server的简称,是微软VSTS的一部分,它是Microsoft应用程序生命周期管理(ALM)工具的核心协作平台, ...

  6. TFS 10周年生日快乐 – TFS与布莱恩大叔的故事

    今天看了一下Brian Harry大叔的博客,才发现2016年3月17日,是Team Foundation Server的10岁生日. Today marks the 10th anniversary ...

  7. TFS二次开发系列:一、TFS体系结构和概念

    TFS是Team Fundation Server的简称,是微软VSTS的一部分,它是Microsoft应用程序生命周期管理(ALM)工具的核心协作平台,简单的说它是管理和开发软件项目的整个生命周期的 ...

  8. [转载]TFS测试管理

    微软2010年发布的Visual Studio 2010或Visual Studio Test Professional 2010包含一个称为 Microsoft 测试管理器的新应用程序,用于帮助您使 ...

  9. [转载]TFS体系结构和概念

    TFS是Team Fundation Server的简称,是微软VSTS的一部分,它是Microsoft应用程序生命周期管理(ALM)工具的核心协作平台,简单的说它是管理和开发软件项目的整个生命周期的 ...

随机推荐

  1. centos7系统运行级别简介

    centos7系统运行级别简介我们知道,centos6及之前的版本中,系统运行级别通过/etc/inittab文件进行设置和控制,但在centos7中,对这个文件的设置将不会对系统运行级别产生影响,这 ...

  2. 如何把已有SQLSERVER数据库更名而且附加到数据库中?

    如何把已有SQLSERVER数据库更名而且附加到数据库中? 例如:已有数据库:zrmaa,希望更名为jjsh 特别提醒:数据库名中不能加入下划线,因为数据库日志文件有下划线. 把数据库文件mdf和数据 ...

  3. 【转】python 中NumPy和Pandas工具包中的函数使用笔记(方便自己查找)

    二.常用库 1.NumPy NumPy是高性能科学计算和数据分析的基础包.部分功能如下: ndarray, 具有矢量算术运算和复杂广播能力的快速且节省空间的多维数组. 用于对整组数据进行快速运算的标准 ...

  4. poj1873(枚举+凸包)

    The Fortified Forest Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 7291   Accepted: 2 ...

  5. 一款非常不错的重写listctrl类-CListCtrlEx

    原文在:https://www.codeproject.com/Articles/28063/An-Extended-MFC-CListCtrl-to-edit-individual-cells li ...

  6. 将GETDATE()转换为指定日期格式的varchar类型

    CREATE FUNCTION [dbo].[FormatDate] (@date as datetime, ) ) ) AS BEGIN ) set @datestring=@formatstrin ...

  7. python实现算术表达式的词法语法语义分析(编译原理应用)

    本学期编译原理的一个大作业,我的选题是算术表达式的词法语法语义分析,当时由于学得比较渣,只用了递归下降的方法进行了分析. 首先,用户输入算术表达式,其中算术表达式可以包含基本运算符,括号,数字,以及用 ...

  8. 剑指Offer 28. 数组中出现次数超过一半的数字 (数组)

    题目描述 数组中有一个数字出现的次数超过数组长度的一半,请找出这个数字.例如输入一个长度为9的数组{1,2,3,2,2,2,5,4,2}.由于数字2在数组中出现了5次,超过数组长度的一半,因此输出2. ...

  9. Linux 驱动——Led驱动1

    led_drv.c驱动文件: #include <linux/module.h>#include <linux/kernel.h>#include <linux/init ...

  10. vue2中使用mint-ui,性别选择

    安装需要的组件 import { DatetimePicker,Toast,Popup,Picker } from 'mint-ui'; templete部分 <div class=" ...