[TFS教程]TFS: Get Command
Get Command
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 |
|
/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
Download (get) files from the Server Use Visual Studio to get files and folders.
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的更多相关文章
- Team Foundation Server 2015使用教程--tfs用户账号切换
- 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 ...
- TFS代码迁移Git
描述 将TFS上的代码迁移到Git做版本控制. 参考地址 tfs-git下载:https://github.com/git-tfs/git-tfs/releases chocolatey安装:http ...
- docker4dotnet #5 使用VSTS/TFS搭建基于容器的持续交付管道
在过去的几篇d4d系列中,我给大家介绍了如何使用docker来支持asp.net core的应用开发,打包的场景.Asp.net core的跨平台开发能力为.net开发人员提供了使用容器进行应用开发的 ...
- TFS API:一、TFS 体系结构和概念
TFS API:一.TFS 体系结构和概念 TFS是Team Fundation Server的简称,是微软VSTS的一部分,它是Microsoft应用程序生命周期管理(ALM)工具的核心协作平台, ...
- TFS 10周年生日快乐 – TFS与布莱恩大叔的故事
今天看了一下Brian Harry大叔的博客,才发现2016年3月17日,是Team Foundation Server的10岁生日. Today marks the 10th anniversary ...
- TFS二次开发系列:一、TFS体系结构和概念
TFS是Team Fundation Server的简称,是微软VSTS的一部分,它是Microsoft应用程序生命周期管理(ALM)工具的核心协作平台,简单的说它是管理和开发软件项目的整个生命周期的 ...
- [转载]TFS测试管理
微软2010年发布的Visual Studio 2010或Visual Studio Test Professional 2010包含一个称为 Microsoft 测试管理器的新应用程序,用于帮助您使 ...
- [转载]TFS体系结构和概念
TFS是Team Fundation Server的简称,是微软VSTS的一部分,它是Microsoft应用程序生命周期管理(ALM)工具的核心协作平台,简单的说它是管理和开发软件项目的整个生命周期的 ...
随机推荐
- [spring源码] 小白级别的源码解析(一)
一直都在用spring,但是每次一遇到spring深入的问题,就是比较懵的状态.最近花了段时间学习了一下spring源码. 1,spring版本介绍 虽然工作中,一直在用到spring,可能有时候,并 ...
- Loadrunner常见的乱码问题
1.录制的脚本出现了乱码 录制的时候出现乱码,如果不影响回放,我们可以不管它,如果影响回放结果,我们可以使用以下方法解决: 1)更改录制选项 选择菜单栏Tools---> ...
- 微信小程序的布局css样式
微信小程序的布局css样式width: fit-content;font-size:20px; /*设置文字字号*/color:red; /*设置文字颜色*/font-w ...
- MapRedcue的demo(协同过滤)
MapRedcue的演示(协同过滤) 做一个关于电影推荐.你于你好友之间的浏览电影以及电影评分的推荐的协同过滤. 百度百科: 协同过滤简单来说是利用某兴趣相投.拥有共同经验之群体的喜好来推荐用户感兴趣 ...
- 【转】.Net Core中的Api版本控制
原文链接:API Versioning in .Net Core 作者:Neel Bhatt 简介 Api的版本控制是Api开发中经常遇到的问题, 在大部分中大型项目都需要使用到Api的版本控制 在本 ...
- Linux 安装 ffmpeg
在安装ffmpeg之前,需要先安装一些必需组件.包括但不限于以下组件(有的系统里面可能已经安装过) 首先在根目录下创建:ffmpeg_sources 1.Yasm sudo apt-get insta ...
- 版本控制git第一篇
一.git的下载与安装 参考:https://blog.51cto.com/wangfeng7399/2352524 Git 是一个开源的分布式版本控制软件,用以有效.高速的处理从很小到非常大的项目版 ...
- python文件读写,以后就用with open语句
读写文件是最常见的IO操作.Python内置了读写文件的函数,用法和C是兼容的. 读写文件前,我们先必须了解一下,在磁盘上读写文件的功能都是由操作系统提供的,现代操作系统不允许普通的程序直接操作磁盘, ...
- 如何避免form提交进行页面跳转
正常的form表单提交后需要进行页面跳转,如果我们不希望进行页面跳转,那么按以下两个步骤,通过一个iframe就可以解决这个问题: 步骤一:首先在页面中定义一个空的不可见的iframe <!-- ...
- 周强 201771010141 《面向对象程序设计(java)》第七周学习总结
实验目的与要求 (1)进一步理解4个成员访问权限修饰符的用途: (2)掌握Object类的常用API用法: (3)掌握ArrayList类用法与常用API: (4)掌握枚举类使用方法: (5)结合本章 ...