dotfiles/fish.configlink/functions/gittools.fish
2020-11-23 22:36:47 -05:00

25 lines
639 B
Fish

#!/usr/local/bin/fish
function gittools
function git-fuzzy-branch -a header
set -l current (git rev-parse --abbrev-ref HEAD | tr -d '\n')
set -l branch (git branch --format "%(refname:short)" | eval "fzf $FZF_DEFAULT_OPTS --header='On $current, $header'")
and echo $branch
end
function git-checkout-fuzzy
set branch (git-fuzzy-branch "checkout branch...")
and git checkout $branch
end
function git-merge-fuzzy
git merge (git-fuzzy-branch "merge from...")
end
function git-delete-fuzzy
git branch -d (git-fuzzy-branch "delete branch...")
end
end