Skip to content

Instantly share code, notes, and snippets.

@dayvsonlima
Created May 25, 2022 18:36
Show Gist options
  • Save dayvsonlima/0b238d0dd4bfeee2a535fd07b0da0e1e to your computer and use it in GitHub Desktop.
Save dayvsonlima/0b238d0dd4bfeee2a535fd07b0da0e1e to your computer and use it in GitHub Desktop.
count words added in git
alias gitwa='git diff --word-diff=porcelain origin/main | grep -e "^+[^+]" | wc -w | xargs'
alias gitwd='git diff --word-diff=porcelain origin/main | grep -e "^-[^-]" | wc -w | xargs'
alias gitwdd='git diff --word-diff=porcelain origin/main |grep -e"^+[^+]" -e"^-[^-]"|sed -e's/.//'|sort|uniq -d|wc -w|xargs'
alias gitw='echo $(($(gitwa) - $(gitwd)))'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment