Disable auto-completion of remote branches in Git Bash?

后端 未结 9 1510
广开言路
广开言路 2020-11-30 01:59

I\'m working on a fairly large git repo with a couple of thousand (remote) branches. I am used to using auto-completion (using [TAB]) in the console (Git Bash in that case),

9条回答
  •  北荒
    北荒 (楼主)
    2020-11-30 02:36

    I'm assuming that you are using the git-completion.bash script, and that you only care about git checkout.

    To accomplish this, I just changed one line in the definition of the _git_checkout () function in git-completion.bash:

    <       __gitcomp_nl "$(__git_refs '' $track)"
    ---
    >       __gitcomp_nl "$(__git_heads '' $track)"
    

    My understanding is that this only affects the tab-completion action (because of its location within the * case of the switch-case statement).

提交回复
热议问题