0

How can I calculate the number of lines added and modified from First commit(initial commit) to Last commit in git?

3

1 Answer 1

1

Either of below commands can be used, stats will be same

1) display stats with count of changed file, insertion count and deletion count

git diff $(git log --pretty=format:"%h" | tail -1) --shortstat

2) display only count of changed and newly added line count, but does not consider deleted line count

git diff $(git log --pretty=format:"%h" | tail -1) | grep '^+' | grep -v +++ | wc -l

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.