我如何设置自动完成的Git命令? [英] How can I set up autocompletion for Git commands?
问题描述
我的Git(版本1.7.2.5)庆典上compeletion我的Debian挤压(6.0)工作。 Git的安装与资质和我使用标准Debian的庆典
,它支持命令行自动完成。
现在,我只是一个其他机器(莱尼/ Debian的5.0)上安装的Git(1.5.6.5)和没有自动完成。
-
为什么不工作的第二台机器上的Git自动完成?我该如何诊断呢?
-
什么让我的机器上完成的工作?我已经看过的文件
混帐completion.bash
,但它似乎并没有被我的机器上。如何完成的Git工作过? -
如何使我能完成的git的其他机器?
您需要源/etc/bash_completion.d/git
启用git的自动完成功能。
在我的的.bashrc
它与完成的:
在/etc/bash_completion.d/*文件;做
源$文件
DONE
I have Git (version 1.7.2.5) bash compeletion working on my Debian squeeze (6.0). Git was installed with aptitude and I am using standard debian's bash
, which supports command line autocompletion.
Now, I just installed Git (1.5.6.5) on an other machine (Lenny/Debian 5.0) and the there is no autocompletion.
Why is Git autocomplete not working on the second machine? How do I diagnose this?
What is making completion work on my machine? I have looked for the file
git-completion.bash
but it doesn't seem to be on my machine. How does Git complete ever work?How can I bring git complete to the other machine?
You need to source /etc/bash_completion.d/git
to enable git auto-completion.
In my .bashrc
it's done with:
for file in /etc/bash_completion.d/* ; do
source "$file"
done
这篇关于我如何设置自动完成的Git命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!