Skip to content

Instantly share code, notes, and snippets.

@Vladnev
Last active August 1, 2018 11:49
Show Gist options
  • Save Vladnev/a47da8f350b3b48f2f40983dfe45d83b to your computer and use it in GitHub Desktop.
Save Vladnev/a47da8f350b3b48f2f40983dfe45d83b to your computer and use it in GitHub Desktop.
Count code rows by author
Count commits by author:
git log --pretty=format:==%an --numstat | \
sed -r '/==.*/{s/^==//;h;D};/^$/D;s/-/0/g;s/\t[^\t]+$//;G;s/(.*)\n(.*)/\2\t\1/' \
| awk -F '\t' '{add[$1]+=$2;del[$1]+=$3} END {for (i in add) {print i,add[i],del[i]}}'
Delete branches(not current && not master):
alias clear-merged-branches='git branch --merged | grep -v -E "(^\*|\bmaster\b)" | xargs git branch -d'
alias clear-branches='git branch | grep -v -E "(^\*|\bmaster\b)" |xargs git branch -D'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment