From 60509de1bf0670f734799ae2818cc4d3fd2b4540 Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Fri, 16 Apr 2021 20:49:01 +0100 Subject: [PATCH] feat(fzf): add command for git check out --- site-modules/core/files/oh-my-zsh/custom/fzf.zsh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/site-modules/core/files/oh-my-zsh/custom/fzf.zsh b/site-modules/core/files/oh-my-zsh/custom/fzf.zsh index f02266b..cb43cba 100644 --- a/site-modules/core/files/oh-my-zsh/custom/fzf.zsh +++ b/site-modules/core/files/oh-my-zsh/custom/fzf.zsh @@ -45,6 +45,13 @@ fshow() { done } +# +# Checkout a git branch in a fzf context +# +fco() { + git checkout "$(git branch -vl | fzf --layout=reverse | awk '{print $1}')" +} + # # Interactive `git add` with FZF and diff preview support. #