# list all local Git branches sorted by their last commit date git-branches() { git for-each-ref --sort=-committerdate --format='%(committerdate:iso8601) %(refname:short)' refs/heads/ }