Nagarjuna Nag
Nagarjuna Nag

Reputation: 41

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

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

Upvotes: 0

Views: 218

Answers (1)

user7154703
user7154703

Reputation:

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

Upvotes: 1

Related Questions