zoukankan      html  css  js  c++  java
  • Git自动补全配置安装(Mac版本)

    首先要安装 bash-completion,看一下自己的bash命令是否可以补全,如果不行要先安装bash-completion

    brew install bash-completion
    下载git源码
    使用如下命令即可下载

    git clone https://github.com/git/git
    复制 git-completion.bash
    源代码下有个 contrib/completion 目录,有个 git-completion.bash 文件

    cd git/contrib/completion/
    将该文件复制到主目录(~)下。注意:复制时,文件名前加一个"点"(.),命令如下:
    cp git-completion.bash ~/.git-completion.bash
    修改主目录下的 .bashrc 文件(如果没有该文件,新建一个)。添加一行代码
    source ~/.git-completion.bash
     

    将下面代码添加到~/.bash_profile(如果没有该文件,新建一个)。

    # git auto completition
    if [ -f ~/.git-completion.bash ]; then
    . ~/.git-completion.bash
    fi
    然后,source一下使其生效

    source ~/.git-completion.bash
    source ~/.bash_profile
    这样就可以,按下Tab键就可以提示啦。(如果还不可以,重启终端试试)

    $ git che
    checkout cherry cherry-pick

    切换mac shell:

    https://support.apple.com/zh-cn/HT208050

  • 相关阅读:
    移动端常用状态
    css 动画
    jQuery源码解析 -- 概述
    Bearer Token && JWT --- 深入理解令牌机制
    字符串 ----> switch-case 语句
    Vuejs选项: provide/inject
    本地windows系统-》windows云服务器文件上传
    CSS基础点
    函数的调用 与 this
    两个有意思的网站
  • 原文地址:https://www.cnblogs.com/sameen/p/14860717.html
Copyright © 2011-2022 走看看