I have configured my .bash_aliases
like:
alias gc="git checkout"
alias gcf="git flow feature checkout"
source ~/.git-completion.bash
__git_complete gc _git_checkout
source ~/.git-flow-completion.bash
__git_complete gcf __git_flow_feature
But when I try to complete I should select checkout
and then I may select my branch:
$ gcf
checkout diff help publish rebase track
delete finish list pull start
$ gcf checkout a
a_branch1 a_branch2
What should I do that checkout
will be selected automatically when I write gcf
+aTAB
I think one solution might lie with custom Git alias completion:
So you'll first need to set up a Git alias in your
.gitconfig
:and then link it in
.bash_aliases
:It's untested but I think it'll do what you want. You might have some trouble with spacing in the
$@
in theffc
alias that\"$@\"
might fix depending on use case.