CLI: Git Checkout Recent Branch with Search & Preview

Published

October 4, 2022

Reading time
1 min read

In the above short video I build up a command to check out a recent git branch with search and preview diff functionality.

The final command from the video is…

git branch --sort=-committerdate | fzf --header "Checkout Recent Branch" --preview "git diff {1} --color=always" --pointer="" | xargs git checkout

The nerd fonts I referred to can be found here… https://github.com/ryanoasis/nerd-fonts

I personally use the JetBrainsMono Nerd Font based on https://www.jetbrains.com/lp/mono/

If you were wondering about the emoji picker I used, it's a feature of the kitty terminal https://sw.kovidgoyal.net/kitty/kittens/unicode_input/

Web Mentions
0
0

Tweet about this post and have it show up here!