将命令行 tf checkin 链接到工作项 [英] Link command line tf checkin to work item

查看:20
本文介绍了将命令行 tf checkin 链接到工作项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过 tf 命令行工具将文件提交到 TFS 存储库,并将提交链接到 TFS 工作项.我该怎么做?

I'd like to commit a file to TFS repository through the tf command-line tool and link the commit to a TFS work-item. How do I do it?

我已经提交了我的文件,但没有指向工作项的链接.

I've gotten as far as committing my file, but without a link to the work-item.

我的命令添加一个新文件并提交更改:

My command adds a new file and commits the changes:

%> tf add foo.cpp
%> tf checkin foo.cpp -comment:"this is cool, but no work-item!"

推荐答案

很遗憾,您无法使用 tf.exe 命令行执行此操作.如果您需要使用 -noprompt 参数进行自动化,那么您可能不走运.

Unfortunately, you can not do this using tf.exe command line. If you need to use the -noprompt parameter for automation then you're likely out of luck.

如果没有 -noprompt 参数,只需在 UI 的 work-item 栏中执行此操作.从您的查询中选择工作项并选中 √,最后检查更改.

Without -noprompt parameter, simply do this in work-item bar from UI. Select the workitem from your query and check the √, finally check in changes.

如果这是您公司的签入政策,您也可以使用 override 参数绕过它作为解决方法.

If this is a checkin policy in your company, you could also use the override parameter to bypass it as a workaround.

tf.exe checkin c:\workSpaceFilepath /comment:"some comment" /override:"Automated Build Process"

更多细节请看这个类似的问题:我可以使用工作项关联从 CLI 签入到 TFS 吗?

More details please take a look at this similar question: Can I check in to TFS from CLI with a work item association?

更新

tf checkin -associate

可以像KlingonJoe 所说的那样做.但是 - associate 已过时

May do the trick as KlingonJoe says. However - associate is out of date

这可能适用于早期版本的 TFS\VS,例如 VS2010 或随处可见的团队资源管理器.但它至少不适用于 TFS2015 和 VS2013 及更高版本.

This may work with earlier version of TFS\VS such as VS2010 or team explorer everywhere. But it's not work for TFS2015 and VS2013 and above at least.

此外,要忽略提示,您可以在 tf check in 命令中直接使用 /noprompt.更多信息,您可以查看此教程.

Moreover, to ignore the prompt, you could directly use /noprompt in your tf check in command. More info you could check this tutorial.

这篇关于将命令行 tf checkin 链接到工作项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆