编写 TFS 命令行脚本,以编程方式获取最新版本、签出和签入 [英] Scripting TFS Command Line for Get Latest Version, Check Out and Check in, programmatically

查看:78
本文介绍了编写 TFS 命令行脚本,以编程方式获取最新版本、签出和签入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 WinXP、VS 2008 和 Team Explorer 连接到 Team Foundation Server.

I use WinXP, VS 2008 and Team Explorer to connect to Team Foundation Server.

我需要编写以下脚本(例如 BAT 文件脚本):

I need to script (e.g. BAT file script) the following:

  • 获取团队项目中文件夹的最新版本.
  • 检出团队项目中文件夹的文件.
  • 签入团队项目中文件夹的文件.

我的TFSProject是$/Arquitectura/Main/,映射到路径C:\TFS\Arquitectura

My TFSProject is $/Arquitectura/Main/, mapped to the path C:\TFS\Arquitectura

有人有任何示例代码或建议吗?

Does anyone have any sample code or suggestions?

推荐答案

在命令行中使用 tf.exe.

Use tf.exe in the command line.

在以下示例中,%PathToIde% 通常位于这样的路径上:%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE,或在 Windows 上x64:%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE(取决于 Visual Studio 版本和安装设置).

In the following examples, the %PathToIde% is usually on a path like this: %ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE, or on Windows x64: %ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE (depending on Visual Studio version and installation settings).

获取示例:

cd C:\TFS\Arquitectura
"%PathToIde%\TF.exe" get $/Arquitectura/Main /recursive

结帐示例:

cd C:\TFS\Arquitectura
"%PathToIde%\TF.exe" checkout $/Arquitectura/Main /recursive

签到示例:

cd C:\TFS\Arquitectura
"%PathToIde%\TF.exe" checkin $/Arquitectura/Main /recursive

有关 tf 命令行.

这篇关于编写 TFS 命令行脚本,以编程方式获取最新版本、签出和签入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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