如何在不创建工作区的情况下从 tfs 获取特定版本的文件夹? [英] How to get specific version of folder from tfs without creating a workspace?
问题描述
我想在特定时间(变更集)获取项目的源代码.所以我需要下载整个文件夹.我想在不同的时间做这件事,处理不同的工作区不是很方便.
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
- 我想从文件夹中获取
ChangeSetNumber
变更集DesiredFolder
在 TFS 项目tProj
- I can access TFS from Visual Studio on my computer
- I want to get the
ChangeSetNumber
Changeset from the folderDesiredFolder
in TFS projecttProj
我从 Visual Studio 命令提示符
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
启动下载的解决方案时需要确认删除源控制关联.
It is necessary to confirm remove source control association when starting the downloaded solution.
推荐答案
我对临时工作区使用以下语法:
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屋!