Git Aliases
18th February, 2023
Some useful git
aliases:
hist
gives a slightly prettier version of the standard loggraphviz
creates a graphviz importable loglg
pretty console based loggingsweep
remove local copies of branches that have already been merged tomaster
ordevelop
[alias]hist = log --oneline --decorate --graphgraphviz = "!f() { echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' \"$@\" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '}'; }; f"lg = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --allsweep = "!f() { git branch --merged | grep -Ev '(*|master|develop)' | xargs -n 1 git branch -d; }; f"