How to get changes statistics per day in Git

483 views Asked by At

What I want is something like this:

2014-12-01,   4 files changed,   244 insertions(+),   58 deletions(-)
2014-12-02, 100 files changed,  3770 insertions(+), 1230 deletions(-)
2014-12-05,  17 files changed,   803 insertions(+),  506 deletions(-)
2014-12-06,   6 files changed,   471 insertions(+),  166 deletions(-)
2014-12-07,  10 files changed,   166 insertions(+),   74 deletions(-)
2014-12-08,  16 files changed, 15096 insertions(+),  186 deletions(-)
2014-12-11,  16 files changed,  1711 insertions(+),   85 deletions(-)
1

There are 1 answers

0
kdopen On

This command will get you very close to what you want. You will need to post-process a little to merge entries for the same day and generate totals.

$ git log --shortstat --reverse  --format="%ci" --no-merges
2012-09-25 10:32:03 -0700
2012-09-25 10:55:39 -0700

 33 files changed, 3759 insertions(+)
2012-09-26 13:13:29 -0700

 1 file changed, 60 insertions(+), 22 deletions(-)
2012-10-05 14:31:02 -0700

 2 files changed, 23 insertions(+), 35 deletions(-)
2012-10-08 17:15:34 -0700

 1 file changed, 27 insertions(+), 20 deletions(-)
2012-10-11 17:08:52 -0700

You can almost certainly play with the date format to restrict it to just the YYYY-MM-DD portion as well.