将VSTS/Azure DevOps中的所有提交详细信息列表导出到文件中? [英] Export list of all commit details in VSTS / Azure DevOps into file?
问题描述
我想将存储库中所有提交的列表(日期时间,作者,评论)导出到文件(任何格式:CSV,XML,JSON,XLS等)中,然后在电子表格中进行分析
I want to export a list of all commits in a repository (date-time, author, comment) into a file (of any format: CSV, XML, JSON, XLS etc.) which I will then analyse in a spreadsheet.
我想计算统计数据,例如:
I want to compute stats such as:
- 每个作者每月的提交次数
- 每次提交的大小(更改的行数和文件数,大小以kB为单位)
- 一天中最繁忙的时间,一周中最繁忙的日子,一年中最繁忙的月份等
这是针对高级管理报告的,因此非技术经理可以了解工作量,而不会因实际代码和内容而盲目.建筑细节.
This is for a high-level management report so non-technical managers can understand the size of effort without blinding them with actual code & architecture details.
似乎没有明显的方法可以做到这一点.我在Git命令行文档中发现了一些复杂的想法,但是没有一个产生此信息.诚然,我不是Git专家.
There seems to be no obvious way to do this. I find a few complicated ideas in Git command line documentation but none that yields this info. Admittedly I am not an expert in Git.
有人知道从VSTS/Azure DevOps或Git命令行获取高层每次提交信息的简单方法吗?
Does anyone know a simple easy way to get high-level per-commit info out of VSTS / Azure DevOps or Git command line?
从直觉上讲,这应该很容易,但是到目前为止,我必须将每个提交的屏幕复制/粘贴到电子表格中,并逐步构建信息.疯狂的手工过程.但是所有这些都可以在提交"下的Azure Devops浏览器界面中看到,所以为什么不能一次全部导出呢?
Intuitively this should be really easy but so far I have to copy/paste each screenful of commits into a spreadsheet and build up the info in steps. Crazily manual process. But it's all viewable in the Azure Devops browser interface under Commits so why can't I export it all at once?
当然,我不是世界上唯一想以此方式分析提交活动的人!但是到目前为止,我在网上找不到任何东西.
Surely I am not the only person on earth who wants to analyse commit activity in this way! But so far I can find nothing online.
推荐答案
感谢@Philippe给出了答案的答案:
Thanks to @Philippe for guiding to the answer:
- 在解决方案的.git子目录中启动MS-DOS命令行
- 问题命令:
git log --pretty=format:%h,%an,%aD,%s > ./GitLog.csv
- 等待
GitLog.csv
文件出现并在电子表格程序中打开
- launch MS-DOS command line in the .git subdirectory for the solution
- issue command:
git log --pretty=format:%h,%an,%aD,%s > ./GitLog.csv
- wait for
GitLog.csv
file to appear and open in spreadsheet program
格式化选项含义:
-
%h
=提交哈希 -
%an
=作者姓名 -
%aD
=提交日期 -
%s
=主题(提交注释)
%h
= commit hash%an
= Author Name%aD
= commit date%s
= subject (comment of commit)
有关更多信息,请参见此处: https://git-scm.com/docs/pretty-格式和 https://devhints.io/git-log-format
See here for more: https://git-scm.com/docs/pretty-formats and https://devhints.io/git-log-format
此解决方案不提供文件数量或每次提交的大小,但这是一个好的开始.
This solution doesn't give number of files or size of each commit, but it's a strong start.
(菲利普,如果您可以在适当的答案中表达您的评论,我会为您提供答案而感激)
(Philippe if you can move your comment in a proper answer rather, I'll give you the credit for providing the answer)
这篇关于将VSTS/Azure DevOps中的所有提交详细信息列表导出到文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!