TFS 命令行 - 哪个服务器?
我目前正在使用 2 个不同的 TFS 服务器。在 Visual Studio 命令提示符中运行 tfs 命令时,如何确定要使用哪个 TFS 服务器。例如,“tf status”需要 TFS 服务器参数来指示针对哪个服务器运行命令。但是,对于其他命令(例如删除),它如何知道要针对哪个服务器执行操作?
提前致谢。
I am currently working with 2 different TFS servers. When running the tfs commands in Visual Studio Command Prompt, how is it determined which TFS server to work with. For example, the "tf status" requires a TFS server parameter indicating which server to run the command against. But, for other commands, like delete for example, how does it know which server to perform the operation against?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
一般来说,命令行工具(
tf.exe
、tfpt.exe
)会根据当前目录映射到的工作空间自动确定服务器。如果您在未映射到任何工作区的目录中运行该命令,则需要显式指定服务器。某些命令需要工作空间(例如
tf edit
),如果没有本地文件夹工作空间映射,您将无法运行它们。要显式指定服务器:
可以使用
/server:http://tfsserver:8080/
使用
/collection:http://tfsserver:8080/tfs/Collection/
/collection
也适用于其他命令,例如witadmin.exe
In general, the command line tools (
tf.exe
,tfpt.exe
) automatically determine the server based upon the workspace that the current directory is mapped to.If you are running the command in a directory that is not mapped in any workspace, then you will need to explictly specify the server. Some commands require a workspace (e.g.
tf edit
) and you will not be able to run them without a local folder workspace mapping.To explicitly specify a server:
can use
/server:http://tfsserver:8080/
use
/collection:http://tfsserver:8080/tfs/Collection/
/collection
also applied to other commands likewitadmin.exe
一般来说,TFS 命令行命令将使用相关文件所在的工作区。因此,如果您使用 tf delete 删除文件,TFS 将使用工作区数据。在您签入之前,它实际上不会在服务器上执行删除操作,但当您签入时,TFS 将使用与工作区关联的服务器。
Generally speaking, the TFS command-line commands will work with the workspace that the relevant files are in. So, if you are deleting a file using
tf delete
, TFS will use the workspace data. It doesn't actually perform the delete on the server until you check in, but when you do, TFS will use the server associated with the workspace.它的工作原理是查看当前位置,然后确定该位置是否有活动的工作空间,如果有,则使用该工作空间。否则,您必须通过指向服务器或本地源位置来告诉它。
It works by looking in the current location and then determining if there is a workspace active in that location, if there it uses that one. Otherwise you have to tell it by pointing at the server or local source locations.