zoukankan      html  css  js  c++  java
  • Mac: mac git 的安装 及实现自动补全

    1.检查是否装了brew 
    $ brew list

    如果没有,拷贝以下命令到终端 回车.可以安装好brew
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    2.查看你是否已经安装了"bash-completion",如果没有,继续往下看:

    $ brew install bash-completion

    #####安装完成之后######

    3.检查Mac是否能显示隐藏文件(以.开头的文件).如果不能拷贝以下命令到终端 回车

    defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder

     

    4.将下面代码添加到~/.bash_profile(如果没有该文件,新建一个) 注: ~/ 表示你mac的个人目录 

    if [ -f ~/.git-completion.bash ]; then
      . ~/.git-completion.bash
    fi
    注意:如果没有安装git.用以下命令安装git
    $ brew install git 

    5.接下来将git源码clone到本地

    $ git clone https://github.com/git/git.git

    6.找到"contrib/completion/"目录下的git-completion.bash,找不到用spotlight搜索一下git-completion

    将该文件拷贝到~/目录下并重命名为.git-completion.bash

    $ cp git-completion.bash ~/.git-completion.bash

    7.在~/.bashrc文件(该目录下如果没有,新建一个)中添加下边的内容

    source ~/.git-completion.bash

    7.好了,重启终端以后就大功告成了 git自动补全 直接一个tab搞定   如果按一个tab出不来,则说明你的输入可以匹配多个命令, 

    连续按两次tab,则提示所有匹配的命令

    $ git --h[tab][tab]--help        --html-path
  • 相关阅读:
    MLlib--FPGrowth算法
    MLlib--SVD算法
    算法--访问单个节点的删除
    算法--环形链表插值
    算法--数组变树
    算法--滑动窗口
    RMAN备份失败之:mount: block device /dev/emcpowerc1 is write-protected, mounting read-only
    OPatch failed with error code 73
    Sybase ASE报错:server Error: 8242, Severity: 16, State: 1
    ORA-00257: archiver error. Connect internal only, until freed
  • 原文地址:https://www.cnblogs.com/ryanzheng/p/10262482.html
Copyright © 2011-2022 走看看