将GIT LOG导出到Excel文件 [英] Export GIT LOG into an Excel file
问题描述
我看过论坛,但是没有运气.
I have looked into the forum, but with no luck.
要求:
运行GIT LOG(格式)命令并将结果写入Excel文件.
Run GIT LOG (format) command and write the results into an Excel File .
我已经看到了一些示例,其中使用GIT Log命令可以将数据写入CSV,但是格式化是加倍的努力.
I have seen examples wherein with GIT Log command, data can be written into a CSV, but formatting is double the effort.
任何实用程序或方法都会有所帮助.
Any utility or approach would be helpful.
谢谢 密林(Milind)
Thanks Milind
推荐答案
Git使您可以控制如何使用pretty
选项格式化日志输出.检查一下:
Git gives your the control on how to format the log output using pretty
option. Check this out:
git log --pretty=format:%h,%an,%ae,%s
这将以(哈希[缩写],作者姓名,作者电子邮件,主题)的格式打印日志.
This prints the log in the format of (hash [abbreviated], author name, author email, subject).
要查看格式选项的完整列表,请执行以下操作:
To see the full list of format options:
git help log
并向下滚动,直到看到格式选项列表.
And scroll down until you see the list of format options.
要重定向输出,请使用>
重定向运算符,如下所示:
To redirect the output, use >
redirection operator as follows:
git log --pretty=format:%h,%an,%ae,%s > /path/to/file.csv
这篇关于将GIT LOG导出到Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!