visual-studio TFS 查询(在 Visual Studio 中)以获取所有签入
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/834107/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
TFS query (in Visual Studio) to get all check-ins
提问by Ola
I'm trying to get a list of all check-ins (limited / ordered by date) via the TFS query editor in Visual Studio Team Explorer.
我正在尝试通过 Visual Studio 团队资源管理器中的 TFS 查询编辑器获取所有签入列表(按日期限制/排序)。
I can make a query that lists all bugs, sprint backlog item or product backlog item, but I can't find the actual check-in. Is it's possible or should I make (SQL) queries directly on the database.
我可以进行一个列出所有错误、冲刺待办事项或产品待办事项的查询,但我找不到实际的签入。是否有可能或者我应该直接在数据库上进行(SQL)查询。
Ideas?
想法?
采纳答案by Lasse V. Karlsen
Just open the Team Explorer window, expand the TFS project, and double-click the Source Control node there.
只需打开 Team Explorer 窗口,展开 TFS 项目,然后双击其中的 Source Control 节点。
Then you can simply right-click a project or directory in TFS source control and select View History, then you'll get all the commits.
然后您只需右键单击 TFS 源代码管理中的项目或目录并选择查看历史记录,您将获得所有提交。
回答by Ray
The tfcommand-line utility(available via VS2010 Command Prompt) provides a way to retrieve the history of all checkins for a specified file or folder.
该tf命令行实用程序(通过VS2010命令提示符可用)提供了一种方法来检索所有签入的历史指定的文件或文件夹。
Specifically, the tf historycommandallows for filtering by date range. For example, to get all of the checkins for the current month of June (i.e. 6/1/11 - 6/30/11), then use the \versionparameter with the date option (D"[start date]"~"[end date]"):
具体来说,该tf history命令允许按日期范围过滤。例如,要获取 6 月当前月份(即 6/1/11 - 6/30/11)的所有签到,请使用\version带有日期选项 ( D"[start date]"~"[end date]")的参数:
tf history c:\MyProject /recursive /version:D"06/1/11"~D"06/30/11"
This will launch an interactive GUI window showing all checkins that occurred between those dates. The GUI window is equivalent to the history windows shown in Visual Studio. Therefore, you can drill down to view changeset details, compare to files to previous versions, etc.
这将启动一个交互式 GUI 窗口,显示这些日期之间发生的所有签到。GUI 窗口等效于 Visual Studio 中显示的历史记录窗口。因此,您可以深入查看变更集详细信息、与以前版本的文件进行比较等。
If you simply want to view the history list without the GUI window then add the parameter /noprompt:
如果您只想在没有 GUI 窗口的情况下查看历史列表,请添加参数/noprompt:
tf history c:\MyProject /recursive /version:D"06/1/11"~D"06/30/11" /noprompt
This will output the results to the command prompt console window.
这会将结果输出到命令提示符控制台窗口。
回答by Your Friend Ken
USE TfsVersionControl
select distinct top 100 c.CreationDate,c.Comment,u.DisplayName, v.Fullpath
from tbl_changeset as c
join tbl_identity as u on u.Identityid = c.OwnerId
join dbo.tbl_Version as v on v.Versionfrom = c.ChangeSetId
Order by c.CreationDate desc
Here is sql report I made to view recent changes.
这是我为查看最近更改而制作的 sql 报告。
回答by Brian
Here is what we use
这是我们使用的
USE [Tfs_DefaultCollection]
SELECT distinct cs.CreationDate, cs.[ChangeSetId], c.DisplayPart, cs.[Comment]
from [tbl_ChangeSet] AS cs
left outer JOIN [tbl_Identity] AS i ON cs.[OwnerId] = i.[IdentityId]
left outer JOIN [Constants] AS c ON i.[TeamFoundationId] = c.[TeamFoundationId]
left outer join dbo.tbl_Version as v on v.Versionfrom = cs.ChangeSetId
WHERE creationdate > '04/12/2012'
and (v.fullpath like '%\Web%'
or v.FullPath like '%\Databases%')
ORDER BY cs.[CreationDate] desc
回答by Mehmet Aras
Check out TFS Sidekick from Attrice. It is a very nice and free tool that I use regularly. It has a history sidekick that allows you to query changesets by user on the source tree node that you select on the left handside of the UI. You can sort the results by date. You can also right click on a changeset to see the details such the files and the workitems.
查看来自 Attrice 的 TFS Sidekick。这是我经常使用的一个非常好的免费工具。它有一个历史助手,允许您在用户界面左侧选择的源树节点上按用户查询变更集。您可以按日期对结果进行排序。您还可以右键单击变更集以查看详细信息,例如文件和工作项。
回答by Martin Woodward
You can view the history of a file or folder by right clicking on the file/folder in the solution explorer or source control explorer windows and then copy/paste the contents of the history if you want it somewhere else.
您可以通过右键单击解决方案资源管理器或源代码管理资源管理器窗口中的文件/文件夹来查看文件或文件夹的历史记录,然后如果需要将历史记录的内容复制/粘贴到其他位置。
More interestingly in the use-case that you seem to be talking about, you can actually pull all this type of information in from the TFS Data Warehouse and do your own reporting on it in Excel. Take a look at the following blog post I did on this topic for more information:
更有趣的是,在您似乎正在谈论的用例中,您实际上可以从 TFS 数据仓库中提取所有此类信息,并在 Excel 中对其进行自己的报告。请查看我针对此主题所做的以下博客文章以获取更多信息:

