一、安裝bash-completion
- 安裝Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - 安裝bash-completion
brew install bash-completion - 根據
bash-completion安裝完成后提示,將[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion加入~/.bash_profile
二、下載git-completion.bash文件
-
拷貝該頁面代碼到本地
~/.git-completion.bash -
將
source ~/.git-completion.bash加入~/.bash_profile -
執行
source~/.bash_profile
