简体   繁体   English

TFS 从特定文件夹获取最新版本

[英]TFS Get latest Version from Specific Folder

I want to create at button to get latest Version of my code from a specific folder without using Team Explorer -> Source Control tree every time.我想创建 at 按钮以从特定文件夹中获取我的代码的最新版本,而无需每次都使用 Team Explorer -> Source Control 树。

So I am trying to make and external tools reference to run the tf.exe get command.所以我正在尝试制作和外部工具参考来运行 tf.exe get命令。

This is what I have so far.这就是我到目前为止所拥有的。

在此处输入图像描述

When I run this is gives me this error:当我运行时,这给了我这个错误:

Unrecognized command option 'workspace'无法识别的命令选项“工作区”

I cant figure out how to provide the workspace name?我不知道如何提供工作区名称?

You can omit the workspace name.您可以省略工作区名称。 tf.exe can resolve the server path and local path mappings because it stores workspace information locally. tf.exe可以解析服务器路径和本地路径映射,因为它在本地存储工作空间信息。

The command you gave is correct (assuming you have $/Dev mapped):您给出的命令是正确的(假设您已映射$/Dev ):

tf.exe get /recursive $/Dev

However it's critical that you have $/Dev mapped directly (not just having children mapped) and unambiguously (you cannot have $/Dev mapped in two different workspaces) or else tf.exe will not be able to determine the correct local path.但是,您必须直接映射$/Dev (不仅仅是映射子级)并且明确(您不能在两个不同的工作区中映射$/Dev ),否则tf.exe将无法确定正确的本地路径。

Since a given local path can only be mapped to a single server path, the easiest way to do this is simply by specifying the local path you wish to get.由于给定的本地路径只能映射到单个服务器路径,因此最简单的方法就是指定您希望获取的本地路径。 For example:例如:

tf.exe get /recursive C:\Dev

Again, this assumes that you have $/Dev mapped to C:\Dev .同样,这假设您已将$/Dev映射到C:\Dev

Command to get latest is获取最新的命令是

tf get /force /recursive /version:W<workspacename>

1 thing to be noticed is the workspace which you have not provided in the Initial Directory text box.需要注意的一件事是您没有在初始目录文本框中提供的工作区。 Provide some path where it will download local copy of files (ie nothing but called workflow).提供一些路径,它将下载文件的本地副本(即除了称为工作流之外什么都没有)。 Provide some path like C:\TFS\Apps提供一些路径,如 C:\TFS\Apps

Aside from the answer that Mrchief gave: if you install the TFS power tools you can use the contextmenü in windows-explorer to check-in/out, etc.除了 Mrchief 给出的答案:如果您安装TFS 电动工具,您可以使用 windows-explorer 中的 contextmenü 进行签入/签出等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM