Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
git csv export of commits in the last month
git log --since='last month' --pretty=format:'%h;%an;%ad;%s' --author='Ionut Colceriu' > ~/log.csv
@phily245
Copy link

phily245 commented May 3, 2016

If the file fails to open in Excel, add the following on a new line at the top of the file: sep=;

@emcarson
Copy link

emcarson commented Aug 25, 2017

Very useful, thanks!

@avs099
Copy link

avs099 commented Oct 31, 2017

add "--all" to get all commits from all branches

@gabrielsimas
Copy link

gabrielsimas commented Feb 9, 2018

Thank you... you help me to create my Dataset...

@flockonus
Copy link

flockonus commented Jun 18, 2018

Thank you!
If the text got no commas (not guaranteed) using , as separator makes it easier to parse CSV
--date=short removes precision but makes easier to parse (Y-M-D)
git log --since='last year' --date=short --pretty=format:'%h,%an,%ad,%s' > ~/log.csv

@AdarshKale
Copy link

AdarshKale commented Sep 22, 2019

Thanks a Lot!!!
How to add multiple authors?

@rkvarra
Copy link

rkvarra commented May 1, 2022

Thanks a Lot!!! How to add multiple authors?

Probably you are looking for this...

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