[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)工具的核心协作平台,简单的说它是管理和开发软件项目的整个生命周期的 ...
随机推荐
- jq初入行常用动画
--jq动画分类--(1)jQuery的动画其实就是将之前提到过的各种特效进行封装,并对其性能进行优化.(2)jQuery动画分为三个部分:非自定义动画,自定义动画,和全局动画设置. 一.非自定义动画 ...
- Linux 安装 ffmpeg
在安装ffmpeg之前,需要先安装一些必需组件.包括但不限于以下组件(有的系统里面可能已经安装过) 首先在根目录下创建:ffmpeg_sources 1.Yasm sudo apt-get insta ...
- css隐藏滚动条依旧可以滚动
在做企业页面的时候,大部分页面都应该是活的,不应该写死,因为要从后台拿数据进行填充.而后台的数据是不确定的,有时候会让我们的容器撑得很大.这时候我们需要隐藏掉滚动条达到美观或者其他布局效果,隐藏掉单个 ...
- linux c使用socket进行http 通信,并接收任意大小的http响应(四)
终于说到SOCKET 这里了.SOCKET进行http通信的实际就是利用socket将http请求信息发送给http服务器,然后再利用socket接收http响应. 由于本文与之通信的服务器是ip已知 ...
- GitHub入门与实践 读书笔记二:Git的导入
1.诞生背景 Linux的创始人Linus Torvalds 在2005年开发了Git的原型程序,后随着众多开发者的共同努力,现在他已经被大量的程序员采用. 2.什么是版本管理 版本管理:管理软件在开 ...
- cut语法
cut是一个选取命令,就是将一段数据经过分析,取出我们想要的.一般来说,选取信息通常是针对“行”来进行分析的,并不是整篇信息分析的. (1)其语法格式为:cut [-bn] [file] 或 cut ...
- 剑指Offer 41. 和为S的连续正数序列 (其他)
题目描述 小明很喜欢数学,有一天他在做数学作业时,要求计算出9~16的和,他马上就写出了正确答案是100.但是他并不满足于此,他在想究竟有多少种连续的正数序列的和为100(至少包括两个数).没多久,他 ...
- python基础--基础练习题(一)
1. 输出如下内容: 1 1 2 1 2 2 3 1 3 2 3 3 4 1 4 2 4 3 4 4 思路:应该是要用两个循环,外层循环控制第一个数字,内层控制输出的次数 for i in range ...
- 编写 python 小程序,将LOL官网的皮肤保存下来,上传百度云,记录那些强撸灰飞烟灭的日子
to 撸的血泪史:大学四年几乎都在宿舍打撸,So,把官网的皮肤都保存下来,存到百度云,就当一种纪念 编辑器:pycharm 用到的包:urllib.request, requests, json, r ...
- noip-2006普及组-数列- 【模拟-找规律-快速幂】
链接:https://ac.nowcoder.com/acm/contest/153/1047 来源:牛客网 题目描述 给定一个正整数k( ≤ k ≤ ),把所有k的方幂及所有有限个互不相等的k的方幂 ...