How do I get bash completion to work with aliases?

后端 未结 12 1069
温柔的废话
温柔的废话 2020-11-28 00:35

Case in point:

I\'m a on mac with bash v3.2.17, I\'m using git installed via macports with the bash_completion variant.

When I type git checkout m<

12条回答
  •  臣服心动
    2020-11-28 01:24

    I have aliased g='git', and combined with my git aliases I type things like

    $ g co 
    

    The simpler fix for my specific use case was to add a single line to git-completion.

    Right below this line:

    __git_complete git _git
    

    I added this line to handle my single 'g' alias:

    __git_complete g _git
    

提交回复
热议问题