Mac OS安装 git , git代码自动补齐

  1. mac安装homebrew
    如果直接按照官网下载安装速度非常满,关键是下载了不一定好事,附上国内镜像,
    /bin/zsh -c “$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)”
  2. 通过 brew install git
    进行下载git
    下载完事 可以通过 git --version 查看其版本
  3. 安装命令补齐
    brew install bash-completion
  4. 安装完成后查看插件信息
    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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值