mac下使用bash-completion进行git命令自动补全

mac下使用bash-completion进行git命令自动补全

本文描述了在mac下通过安装bash-completion的方式使用git命令补全.

  • 检查是否已经安装

  • $ brew list

若未安装,则使用homebrew安装

 brew install bash-completion

安装完成后查看插件信息

$ brew info bash-completion

bash-completion: stable 1.3 (bottled)
Programmable completion for Bash 3.2
https://bash-completion.alioth.debian.org/
/usr/local/Cellar/bash-completion/1.3_1 (190 files, 667K) *
  Poured from bottle on 2017-01-08 at 23:47:57
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/bash-completion.rb
==> Caveats
Add the following lines to your ~/.bash_profile:
  [ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

*按照提示将插件输出内容加入~/.bash_profile
#将下方内容添加到~/.bash_profile
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion

添加git补全支持

$ cd /usr/local/etc/bash_completion.d
$ curl -L -O https://raw.github.com/git/git/master/contrib/completion/git-completion.bash
$ brew unlink bash-completion
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值