diff options
-rw-r--r-- | bash/bash_completion.d/git.bash | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/bash/bash_completion.d/git.bash b/bash/bash_completion.d/git.bash index 8e10910b..34a6f5ef 100644 --- a/bash/bash_completion.d/git.bash +++ b/bash/bash_completion.d/git.bash @@ -52,6 +52,32 @@ _git() { 2>/dev/null) ;; + # Complete with remote subcommands and then remote names + remote) + local word + while IFS= read -r word ; do + [[ -n $word ]] || continue + COMPREPLY[${#COMPREPLY[@]}]=$word + done < <( + if ((COMP_CWORD - sci > 1)) ; then + git remote 2>/dev/null + else + compgen -W ' + add + get-url + prune + remove + rename + set-branches + set-head + set-url + show + update + ' -- "${COMP_WORDS[COMP_CWORD]}" + fi + ) + ;; + # Complete with ref names *) local ref |