CLI: Git Checkout Recent Branch with Search & Preview


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…

I personally use the JetBrainsMono Nerd Font based on

If you were wondering about the emoji picker I used, it's a feature of the kitty terminal

Web Mentions

Tweet about this post and have it show up here!