Add recent alias to show 10 most recent branches

This commit is contained in:
Kenneth Benzie 2022-01-12 18:04:50 +00:00
parent 2615350bb8
commit 0514ccd0c3

6
config
View File

@ -21,6 +21,12 @@
local = !git branch -vv | \ local = !git branch -vv | \
cut -c 3- | \ cut -c 3- | \
awk '$3 !~/\\[/ { print $1 }' awk '$3 !~/\\[/ { print $1 }'
recent = !git reflog show --pretty=format:'%gs ~ %gd' --date=relative | \
grep 'checkout:' | \
grep -oE '[^ ]+ ~ .*' | \
awk -F~ '!seen[$1]++' | \
head -n 10 | \
awk -F ' ~ HEAD@{' '{printf(\" %s \\033[33m%s\\033[0m\\n\", $1, substr($2, 1, length($2)-1))}'
create = checkout -b create = checkout -b
delete = branch -D delete = branch -D
refname = rev-parse --abbrev-ref HEAD refname = rev-parse --abbrev-ref HEAD