From 0e4fcdf3b808bfdde37c3889bfb746cbc99d9151 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Tue, 18 Sep 2018 11:26:09 +0200 Subject: [PATCH] Some useful aliases, for stats and such --- .gitconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.gitconfig b/.gitconfig index aa5c5db..571fbde 100644 --- a/.gitconfig +++ b/.gitconfig @@ -21,6 +21,18 @@ r = !GIT_NO_PAGER=1 git l -30 l = "!. ~/.githelpers && pretty_git_log" + # Some inspiration from https://gist.github.com/mwhite/6887990 + # list branches sorted by last modified + b = "!git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'" + + # https://www.commandlinefu.com/commands/view/4519/list-all-authors-of-a-particular-git-project + authorstats = "!git log --format='%aN <%aE>' | awk '{arr[$0]++} END{for (i in arr){print arr[i], i;}}' | sort -rn" + authors = !git log --format='%aN' | sort -u + authorsemail = !git log --all --format='%cN <%cE>' | sort -u + + # list aliases + la = "!git config -l | grep alias | cut -c 7-" + [push] default = simple