Skip to content

Instantly share code, notes, and snippets.

@joshuabaker
Created March 30, 2015 10:58
Show Gist options
  • Save joshuabaker/179e1a9ff6f727cdc7e5 to your computer and use it in GitHub Desktop.
Save joshuabaker/179e1a9ff6f727cdc7e5 to your computer and use it in GitHub Desktop.
Get a line change count for additions and deletions between two commits — replace ‘commit1’ and ‘commit2’ with commit hashes — optionally by author.
git log --numstat --pretty="%H" commit1..commit2 | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d, -%d\n", plus, minus)}' --author="Your Name"
@spetex
Copy link

spetex commented Jul 21, 2017

I think that the author parameter needs to come before the pipe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment