git: Add an alias for getting branches recently updated

This commit is contained in:
Sanchayan Maity 2023-06-17 11:21:22 +05:30
parent 89dd0df8a1
commit 3421c83582
Signed by: sanchayanmaity
GPG key ID: 6F6A0609C12038F3

View file

@ -3,6 +3,12 @@
addIgnoredFile = false addIgnoredFile = false
[alias] [alias]
jump = !/usr/share/git/git-jump/git-jump 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] [blame]
# Mark any lines that have had a commit skipped using --ignore-rev with a `?` # Mark any lines that have had a commit skipped using --ignore-rev with a `?`
markIgnoredLines = true markIgnoredLines = true