GIT 自动补全

照网上的其他人写的安装遇到一些问题,最后按下面这个地址中的步骤安装OK
https://github.com/bobthecow/git-flow-completion/wiki/Install-Bash-git-completion

其他参考:
https://stackoverflow.com/questions/12399002/how-to-configure-git-bash-command-line-completion
https://blog.csdn.net/chenbifeng/article/details/51570606
https://github.com/yszheda/wiki/wiki/git-tips#bash_autocomplete_Unknown_option_listcmdslistmainporcelainothersnohelpersaliaslistcompleteconfig

这里只记录下Mac下的,其他系统请直接看上面链接。

  1. Homebrew 应该都有的的吧

  2. brew install git bash-completion .
    安装git 和 bash-completion ,已安装跳过。
    (Install Git and bash-completion: brew install git bash-completion (Note: If this install fails with a 404 error, and you already have git installed, just remove the git part of this brew install))

  3. Add bash-completion to your ~/.bash_profile:
    将以下语句追加到~/.bash_profile文件中(没有则创建)

[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion || {
    # if not found in /usr/local/etc, try the brew --prefix location
    [ -f "$(brew --prefix)/etc/bash_completion.d/git-completion.bash" ] && \
        . $(brew --prefix)/etc/bash_completion.d/git-completion.bash
}
  1. source ~/.bash_profile

感觉要注意不同系统,不同系统版本(mac的bash版本),不同git版本 ,安装和配置方式可能都有区别。遇到问题google 、baidu吧,我就遇到按tab 提示的时候出现Unknown option: --list-cmds=list-mainporcelain,others,nohelpers,alias,list-complete,config

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值