在安装了bash-completion的情况下依旧无法补全
解决方法
- 新建文件
~/.git-completion.bash
- 复内容到
git-completion.bash
中,https://github.com/git/git/blob/master/contrib/completion/git-completion.bash - 在
~/.bash_profile
中新增一行source ~/.git-completion.bash
- 执行
source ~/.bash_profile
bash
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash && echo "source ~/.git-completion.bash" >> ~/.bash_profile && source ~/.bash_profile