From 3421c83582bc2a1d6236f70d18256a50f88626f7 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Sat, 17 Jun 2023 11:21:22 +0530 Subject: [PATCH] git: Add an alias for getting branches recently updated --- git/.gitconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/git/.gitconfig b/git/.gitconfig index bf7ce3a..d1bd754 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -3,6 +3,12 @@ addIgnoredFile = false [alias] jump = !/usr/share/git/git-jump/git-jump + # Based on https://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit + recent = "!rb() { \ + git branch --all --color=always --sort=-committerdate \ + --format='%(HEAD) %(color:bold green)%(committerdate:relative)%(color:reset)|%(color:yellow)%(refname:short)%(color:reset)|%(subject)' \ + | head -n ${1:-15} | column -ts'|'; }; \ + rb" [blame] # Mark any lines that have had a commit skipped using --ignore-rev with a `?` markIgnoredLines = true