Skip to content

Instantly share code, notes, and snippets.

@adamthebig
Created March 17, 2016 21:21
Show Gist options
  • Select an option

  • Save adamthebig/9d2cf1281797c3f9f958 to your computer and use it in GitHub Desktop.

Select an option

Save adamthebig/9d2cf1281797c3f9f958 to your computer and use it in GitHub Desktop.
Export commits from a git repo into a pretty spreadsheet (CSV)
git log --pretty=format:'"%h","%an","%aD","%s",' --shortstat --no-merges | paste - - - > log.csv
@mochadwi
Copy link

thanks @adamthebig

@aledc7
Copy link

aledc7 commented Oct 9, 2023

Thank you! very useful...

Here is ahother variant only with the date and text commit:

git log --pretty=format:'"%ad","%s",' --date=short > log.csv

@Quarantiine
Copy link

Does it also show the commit message descriptions?

@Quarantiine
Copy link

This should show commit message itself, the commit message's description, and date only

git log --no-merges --pretty=format:'"%ad","%s","%b"' --date=short > gitLogs.csv

Example:

"2026-01-15","feat: Enhance context agent with dynamic file selection and configuration fetching","Refactor context selection to integrate configuration data, support targeted line range reading, and improve command safety verification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment