【问题标题】:Use tf.exe to create a new label from an existing label使用 tf.exe 从现有标签创建新标签
【发布时间】:2019-10-10 06:27:03
【问题描述】:

在 Visual Studio 中,可以从与现有标签关联的文件中创建新的源代码管理标签。

我将如何在 Powershell 脚本中使用 tf.exe 执行此操作?

【问题讨论】:

    标签: powershell tfs


    【解决方案1】:

    这可以通过tf.exe label 命令上的/version 参数实现。

    Documentation 说明/version 参数的格式应为 L 后跟标签名称:

    # Create an alias to tf.exe
    Set-Alias tf "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exe"
    
    $labelName = "New label"
    $labelComment = "Comment on new label"
    $previousLabelName = "Nightly Build"
    $sourceFolder = "C:\Folder\Containing Source\"
    
    tf label $labelName $sourceFolder /comment:$labelComment /version:L$previousLabelName /recursive /child:Replace
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-22
      • 1970-01-01
      • 2011-07-08
      • 1970-01-01
      相关资源
      最近更新 更多