- mac安装homebrew
如果直接按照官网下载安装速度非常满,关键是下载了不一定好事,附上国内镜像,
/bin/zsh -c “$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)” - 通过 brew install git
进行下载git
下载完事 可以通过 git --version 查看其版本 - 安装命令补齐
brew install bash-completion - 安装完成后查看插件信息
brew info bash-completion
bash-completion: stable 1.3 (bottled)
Programmable completion for Bash 3.2
https://salsa.debian.org/debian/bash-completion
Conflicts with:
bash-completion@2 (because each are different versions of the same formula)
/usr/local/Cellar/bash-completion/1.3_3 (190 files, 685KB)
Poured from bottle on 2020-09-30 at 16:57:07
From: https://mirrors.ustc.edu.cn/homebrew-core.git/Formula/bash-completion.rb
==> Caveats
Add the following line to your ~/.bash_profile:
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
==> Analytics
install: 9,650 (30 days), 28,050 (90 days), 142,599 (365 days)
install-on-request: 8,775 (30 days), 25,959 (90 days), 132,049 (365 days)
build-error: 0 (30 days)
[[ -r “/usr/local/etc/profile.d/bash_completion.sh” ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
这一句添加到按照提示将插件输出内容加入~/.bash_profile
5.添加补齐
$ cd /usr/local/opt/bash-completion/etc/bash_completion.d
$ curl -L -O https://raw.github.com/git/git/master/contrib/completion/git-completion.bash
$ cp git-completion.bash ~/.git-completion.bash
source ~/.git-completion.bash