Git Auto-complete无法在bash中运行

Mys*_*ode 3 git bash autocomplete

我最近安装了git.我正在使用Ubuntu 14.04.但是,自动完成功能无效.

每当我键入git i那么TAB它应该是git init,但它并没有这样发生.我已尝试过本页提到的所有内容,但仍未成功.

每当我做git in那么TAB它似乎像Git是执行ping主机不明.以下是截图:

在此输入图像描述

我该如何解决这个问题?

Cod*_*ard 12

将此脚本用于Ubuntu:

https://github.com/git/git/blob/master/contrib/completion/git-completion.bash

阅读有关如何设置的文档:

 To use these routines:

    1) Copy this file to somewhere (e.g. ~/.git-completion.bash).
    2) Add the following line to your .bashrc/.zshrc:
       source ~/.git-completion.bash
    3) Consider changing your PS1 to also show the current branch,
       see git-prompt.sh for details.
Run Code Online (Sandbox Code Playgroud)

更短的解决方案:

# install the bash-completion vai apg-get 
sudo apt-get install git bash-completion
Run Code Online (Sandbox Code Playgroud)

  • 终于解决了问题.问题似乎是我的.bashrc文件..i用/etc/skel/.bashrc替换〜/ .bashrc现在它正在工作 (4认同)
  • 我执行了步骤1和2仍然没有成功。 (2认同)