Skip to content

Instantly share code, notes, and snippets.

@creative-quant
Created April 27, 2016 20:57
Show Gist options
  • Save creative-quant/34126ab9fbcb4e1921b753302966b542 to your computer and use it in GitHub Desktop.
Save creative-quant/34126ab9fbcb4e1921b753302966b542 to your computer and use it in GitHub Desktop.
a script to get git user and project stats
#!/bin/bash
echo "by $USER"
git log --shortstat --author "$USER" \
| grep "files\? changed" \
| awk '{files+=$1; inserted+=$4; deleted+=$6} END \
{print "files changed", files, "lines inserted:", inserted, "lines deleted:", deleted}'
echo "total"
git log --shortstat \
| grep "files\? changed" \
| awk '{files+=$1; inserted+=$4; deleted+=$6} END \
{print "files changed", files, "lines inserted:", inserted, "lines deleted:", deleted}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment