diff --git a/conf.d/forgit.plugin.fish b/conf.d/forgit.plugin.fish index c9fefd0..fd003d8 100644 --- a/conf.d/forgit.plugin.fish +++ b/conf.d/forgit.plugin.fish @@ -304,7 +304,11 @@ function forgit::checkout::branch -d "git checkout branch selector" --argument-n forgit::inside_work_tree || return 1 if test -n "$input_branch_name" - git checkout -b "$input_branch_name" + if git branch --list | grep "$input_branch_name" > /dev/null + git switch "$input_branch_name" + else + git switch -c "$input_branch_name" + end set checkout_status $status git status --short return $checkout_status