将变更集与工作项git-tfs相关联

时间:2014-06-03 07:53:15

标签: tfs changeset workitem git-tfs associate

我已经尝试过搞清楚但到目前为止没有成功。我正在使用git-tfs检查我对TFS的更改(使用GIT存储库进行本地化)

我读到了这个问题,该问题简要描述了您可以使用元数据(TF26198 error when doing git tfs rcheckin)在提交消息中关联工作项。我尝试使用的命令:

1)

git tfs checkin -m "Changes to workitem #12345" => doesn't associate changeset to TFS workitem

2)

git tfs rcheckin -w12345 -m "Changes to workitem 12345" => triggers error "error: This syntax with one parameter is only allowed in bare repository." 

3)

git tfs checkin -w12345 -m "Changes to workitem 12345" => triggers error No TFS parents found

4)

git tfs checkin -m "Changes to workitem #12345" => doesn't associate work item

关于我做错的任何想法?

谢谢, 尤利亚

2 个答案:

答案 0 :(得分:4)

尝试在-w12345后添加:a,如下所示:

git tfs rcheckin -w12345:a -m "Changes to workitem 12345"

git tfs checkin -w12345:a -m "Changes to workitem 12345"

您也可以使用:r代替:a来解决问题"而不是"关联"

如果您没有指定值,我认为它应该默认为:a,但这对我来说无效。

答案 1 :(得分:1)

首先,您应该了解checkinrcheckin之间的区别(请参阅git-tfs documentation for the commands for that ......这会有所帮助!)

Then commit message are analysed仅与rcheckin(而不是checkin)查找工作项关联,因此1)和4)无法正常工作。

2)这条消息很奇怪,但是因为rcheckin不应该那样工作。

3)今天刚刚发现(多么巧合!)这个synthax中有一个错误(我从来没用过!)。只需使用:

git tfs checkin -w12345:-m"对工作项目的更改12345"

或    git tfs checkin -w12345:a -m"对工作项目的更改12345"

通过错误...

但是你得到的错误告诉我你有一个更大的问题(没有与workitem协会联系)并且你错过了git-tfs的东西(但我不知道:()

为了您的信息,我强烈建议使用rcheckin而不是checkin命令,这些命令会产生很多合并的历史记录。

rcheckin更简单。使用#12345在提交消息中关联工作项并执行所有git提交,当您满意时,从tfs获取,重新定义您的工作(或执行git tfs pull -r)并执行:

git tfs rcheckin

一切都应该没问题!

另请查看我们的use cases