I've shared it before but my tool for switching git branches based on time (it's called flog because I always read reflog as re-flog not ref-log)
flog () {
branch="$(
git branch --sort=-committerdate --format="%(committerdate:relative)%09%(refname:short)%09%(subject)" \
| column -ts $'\t' \
| fzf \
| sed 's/.*ago \+\([^ ]*\) .*/\1/'
)"
git co $branch || (
echo -n "git co $branch" | pbcopy
)
}
I have a much longer one for switching between PRs requesting my review and previewing them while I do it.edit: funny story, I went to add 4 spaces to the start of each line and it turns out I did the same thing last time and my autocomplete got it for me which flog | sed 's/^/ /' | pbcopy