Homebrew’s `git` not using completion

后端 未结 18 2040
盖世英雄少女心
盖世英雄少女心 2020-12-22 16:25

When using OSX’s git, after I modify a file I can simply do git commit , and that’ll auto complete the file’s name to the one that was modified. Howe

18条回答
  •  别那么骄傲
    2020-12-22 16:39

    Step 1: Download auto completion script:

    cd ~
    curl -O https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
    

    Step 2: Update .bash_profile and .bashrc

    echo "source ~/git-completion.bash" >> .bash_profile
    

    Via https://www.anintegratedworld.com/git-tab-autocomplete-on-osx-10-11-el-capitan/

    If above does not work, try https://github.com/bobthecow/git-flow-completion/wiki/Install-Bash-git-completion

提交回复
热议问题