【问题标题】:How to enable branch hints in Mac OS git?如何在 Mac OS git 中启用分支提示?
【发布时间】:2015-08-20 03:24:47
【问题描述】:

在 Windows 中,当我使用 git bash 时,例如想要结帐到某个分支,点击选项卡会显示所有分支,或者如果我写了部分分支名称,则填写分支名称。在我的 Mac OS 中,当我从终端使用 git 时,这些功能被禁用。有没有办法启用它们,以及如何启用?

【问题讨论】:

    标签: macos git terminal


    【解决方案1】:

    你必须安装git-autocomplete,可以通过homebrew获得:

    1. 安装 Git 和 bash-completion:brew install git bash-completion(注意:如果此安装失败并出现 404 错误,并且您已经安装了 git,只需删除此 brew install 的 git 部分)

    2. 将 bash-completion 添加到您的 .bash_profile:

    if [ -f `brew --prefix`/etc/bash_completion ]; then
        . `brew --prefix`/etc/bash_completion
    fi
    

    【讨论】:

    • 当然)只需要等待 5 分钟:D)
    【解决方案2】:

    注意:同样的 git completion 在 Git 2.11(2016 年第四季度)中变得更加完整

    参见Chris Packham (cpackham)commit 49416ad(2016 年 8 月 24 日)。
    (由 Junio C Hamano -- gitster -- 合并于 commit a229a30,2016 年 10 月 10 日)

    命令行补全脚本(在contrib/中)学会补全“git cmd ^mas<HT>”来补全negative end of reference到“git cmd ^master”。

    【讨论】:

      猜你喜欢
      • 2012-08-29
      • 1970-01-01
      • 2017-09-19
      • 2011-11-09
      • 1970-01-01
      • 2016-08-15
      • 1970-01-01
      • 1970-01-01
      • 2013-05-08
      相关资源
      最近更新 更多