How to Perform a TFS get to a supplied or current directory path, ignoring workspace settings

强颜欢笑 提交于 2019-11-29 09:42:47
Edward Thomson

You'll need a workspace to do a get, but it need not be the same workspace that you're using for Visual Studio. In fact, you can just create a simple throwaway workspace, for example:

# {{Server}} is http://server:8080/tfs/DefaultCollection; for readability.

tf workspace /new temp_workspace /collection:{{server}} /noprompt
tf workfold /map $/Project/Project C:\Build\Project
tf get C:\Build\Project /recursive /noprompt
tf workspace /delete temp_workspace /collection:http{{server}} /noprompt

Note that the TFS SDK does provide mechanisms to do a download of an Item without needing to create a workspace, so you could write a program to do this, but it would be a fair amount of code to avoid creating a workspace which is, ultimately, a fairly inexpensive operation.

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