Mac平台下git命令自动补全

一、安装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` `

猜你喜欢

转载自www.cnblogs.com/steinven/p/9271494.html