Scripting TFS Command Line for Get Latest Version, Check Out and Check in, programmatically

[亡魂溺海] 提交于 2019-11-29 18:47:58
Ewald Hofman

Use tf.exe in the command line.

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).

Example for get:

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

Example for checkout:

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

Example for checkin:

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

See for more information on the tf commandline.

Update for VS2017

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exe'

"C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\tf.exe" get "$/ProjectName/Main" /force /recursive

krish

get up to date code for Windows 7 64bit

"%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe" get /recursive

This worked for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!