步骤:
1、安装homebrew(百度homebrew,homebrew主页有安装方式)。
2、安装git(已安装的可跳过)
brew install git
3、使用homebrew安装bash-completion,在终端输入如下命令:
brew install bash-completion
4、安装完成后在终端输入命令:
brew info bash-completion
Add the following lines to your ~/bash_profile下面的代码复制到~/.bash_profile文件内(不存在就新建)。
即可实现终端和git命令的自动补全。