Manu Krishna
Solutions Architect
© 2023 All rights reserved.
How to export commit log from git to csv
There will be times you will come across situation to extract/export entire commit log from git to a csv file.
You can make use of git log and git gives you several options to format (–pretty) and export only the required fields.
git log --no-merges --pretty=format:%h,%an,%ae,%s,%as > /path/to/file/log_file_name.csv
This prints the log in the format of (hash [abbreviated], author name, author email, subject, date)
To see list of format options:
git help log
You have options to set date range and various other criteria which can be found in help
Thanks for your blog, nice to read. Do not stop.