Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why 'git ls-files' is not shown on tab completion?

Tags:

git

bash

Recently I found the command

git ls-files

and I find it very useful (see the it with -h option). Why doesn't it appear if i type git and then press Tab?

I mean - where is the list of "other" commands of git?

like image 317
Adobe Avatar asked Mar 27 '12 05:03

Adobe


1 Answers

Look at your ~/.git-completion.sh and the __git_list_porcelain_commands() function. The commands that git supports but won't tab-complete are listed there. Most of these commands are so-called "plumbing" commands, including ls-files. You can easily make them tab-completed by commenting the respective line. Like this:

#ls-files)         : plumbing;;
#ls-remote)        : plumbing;;
#ls-tree)          : plumbing;;
like image 137
Penghe Geng Avatar answered Oct 01 '22 03:10

Penghe Geng