如何从tfs获取特定版本的文件夹而不创建工作区? [英] How to get specific version of folder from tfs without creating a workspace?

查看:1879
本文介绍了如何从tfs获取特定版本的文件夹而不创建工作区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在特定时间(变更集)获取项目的源代码。所以我需要做下载整个文件夹。我想做不同的时间和处理不同的工作空间不是很方便。

I would like to get the source code of a project at specific time (changeset). So I need do download whole folder. I would like to do it for different times and handling a different workspace is not very convenient.

我知道 TFS将特定版本导入单独的文件夹(带有工作空间)和需要命令从TFS获取文件而不使用工作空间(一个文件)。

I know about TFS Get Specific Version into separate folder (with workspace) and Need command to get a file from TFS without a workspace (one file).

有没有创建整个文件夹的解决方案一个新的工作区?

Is there some solution for whole folder without creating a new workspace?

编辑
我发现接受的答案过于雄心勃勃。我需要更简单的东西。

Edit I have found the accepted answer too ambitious. I needed something more simple.

假设:


  • 我可以从我的计算机上的Visual Studio访问TFS

  • 我想从文件夹
    DesiredFolder ChangeSetNumber >在TFS项目 tProj

  • I can access TFS from Visual Studio on my computer
  • I want to get the ChangeSetNumber Changeset from the folder DesiredFolder in TFS project tProj

我从目标文件夹运行以下批处理

I run the following batch from a destination folder in Visual Studio Command Prompt

set workspace_name=TemporaryWorkspace%username%
set changeset= ChangeSetNumber                
tf workspace -new %workspace_name% -noprompt
tf workfold -map $/tProj . -workspace:%workspace_name%
tf get $/tProj/DesiredFolder -version:C%changeset% -recursive -noprompt
tf workfold -unmap . -workspace:%workspace_name%
tf workspace -delete %workspace_name% -noprompt

推荐答案

我将此语法用于临时工作空间:

I use this syntax for temporary workspaces:

tf workspace -new %JOB_NAME%;%user% -noprompt -server:http://%host%:8080/tfs/%project% -login:%user%,%password%
tf workfold -map $/Release/MilestoneX.X . -workspace:%JOB_NAME% -server:http://%host%:8080/tfs/%project% -login:%user%,%password%
tf get . -version:L%TFS_LABEL% -recursive -noprompt -login:%user%,%password%
tf workfold -unmap . -workspace:%JOB_NAME% -login:%user%,%password%
tf workspace -delete %JOB_NAME%;%user% -noprompt -server:http://%host%:8080/tfs/%project% -login:%user%,%password%

这篇关于如何从tfs获取特定版本的文件夹而不创建工作区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆