Just another random geek-speak blog

Wednesday, May 4, 2011

Simple TF.exe example to add, checkin and delete a file in TFS from the commmand line

I was asked a question earlier today and I thought it might be useful to share the answer.

 .. I am trying to find a way to check in artifacts into TFS via command line utilities.  I have found a ton of documents on “tf”, but can not seem to locate that binary, any quick thoughts”

 Below are the contents of a quick example bat file:

 

@Echo OFF

REM My root workspace is c:\-x-\_TFS_

set tfPath = "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe"

cd c:\-x-\_TFS_\Test\

dir ..\..\*.* >> test.txt

"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" add test.txt /lock:none

"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" checkin /comment:"just a demo of tf.exe" /noprompt .\test.txt

"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" delete test.txt /lock:none

"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" checkin /comment:"just cleaning up a demo of tf.exe"  .\test.txt

0 comments:

Post a Comment

Search This Blog

Loading...

Share it

Followers