简体   繁体   中英

Get latest from tfs server using CLI

Im working on this command line which should allow me to get latest version from my team foundation server. I just made a lot of google look up and everytime I got stuck.

Here is what I got and what I want.

I want to get latest version from a directory ("$/projects/name") recursive and place it in a local folder ("D:\\destination")

This is where I got stuck trying to do the call:

"C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\IDE\\tf.exe" get "$/projects/name" /force /recursive "D:\\destination" /server:tfs.server.net

this would make sense to me, but somehow it doesn't work.

I use the new tfs 11.

Team Foundation Server uses workspace mappings to configure where server paths should be downloaded on to the local filesystem. This allows for very complex source control configuration scenarios, but it also means that you'll need to do a few more steps before downloading your code: namely, creating a workspace and setting the workspace mappings before finally performing the get .

To do this with the TFS command-line client:

tf workspace /collection:http://server:8080/tfs/DefaultCollection /new /noprompt WORKSPACE_NAME
tf workfold /collection:http://server:8080/tfs/DefaultCollection /map $/Server/Path C:\Local\Path
tf get C:\Local\Path

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM