For this you need to use --stat option to git diff or if you are doing it in a script then use --numstat option
Let’s see how we implement it with --stat option:
git diff --stat <commit-ish> <commit-ish>
--stat produces the human-readable output you're used to seeing after merges
you were looking to do this on multiple commits at the same time - that's a task for git log. Since git log internally calls the diff machinery to print requested information,
git log --author="Your name" --stat <commit1>..<commit2>
you can use this command for multiple commits at the same time.
Here's a one-liner to get total changes instead of pre-commit changes from git log (change the commit selection options as desired):
git log --numstat --pretty="%H" --author="Your Name" commit1..commit2 | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d, -%d\n", plus, minus)}'
Reference: https://git-scm.com/docs/git-log