I have a single git commit and would need to get the total number of insertions and deletions.
I know "git show <SHA>
" is showing about details of my commit but I am not sure how to get total number of changes only from a particular commit.
git diff --stat <SHA1> <SHA2>
also does't work because I should use only a single commit.
Kindly share me if you have any information.
You should still be able to use git diff --stat
:
git diff --stat <SHA>~ <SHA>
# or, for a global total only:
git diff --shortstat <SHA>~ <SHA>
The ~
refers to the direct parent of <SHA>
. You are only using one <SHA>
: the commit <SHA>
, and its direct parent <SHA>~
.
For example:
C:\Users\vonc\prog\git\git>git diff --stat e646ab9cf83025e1000db6ec3c1716f978b099f2~ e646ab9cf83025e1000db6ec3c1716f978b099f2
po/TEAMS | 8 +-
po/ca.po | 3949 ++++++++++++++++++++++++++++++-------------------------
po/de.po | 3776 +++++++++++++++++++++++++++++-----------------------
po/fr.po | 3746 +++++++++++++++++++++++++++++-----------------------
po/git.pot | 3547 +++++++++++++++++++++++++++----------------------
po/sv.po | 3723 +++++++++++++++++++++++++++++-----------------------
po/vi.po | 3762 +++++++++++++++++++++++++++++-----------------------
po/zh_CN.po | 4217 +++++++++++++++++++++++++++++++++--------------------------
8 files changed, 15007 insertions(+), 11721 deletions(-)
For just the total:
C:\Users\vonc\prog\git\git>git diff --shortstat e646ab9cf83025e1000db6ec3c1716f978b099f2~ e646ab9cf83025e1000db6ec3c1716f978b099f2
8 files changed, 15007 insertions(+), 11721 deletions(-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With