Baiqing
Baiqing

Reputation: 1343

Find detailed git log after certain commit

For grading purposes, I want to find the metric of how many lines any author committed after a certain commit. I looked at git log but there is just too much data for it to be reasonably counted. Is there another method to get this information?

Upvotes: 0

Views: 35

Answers (1)

You can use git log to see what files have changed and how many lines of them:

git log --author="aerabi" --pretty=tformat: --numstat

The output would look like this:

10      67      tsconfig.json
2       2       package-lock.json
1       1       package.json
25      0       README.md

First column for added and the second for removed.

And because it's a simple git log, you can limit the commits in many different ways:

Last 5 commits

git log --author="aerabi" --pretty=tformat: --numstat -n4

One certain days

git log --author="aerabi" --pretty=tformat: --numstat --before=2022-01-13 --after=2021-07-12

Upvotes: 1

Related Questions