Vim uses wildignore
to filter the list of completions when expanding wildcards. Make sure that .gitignore
doesn't match a file pattern in that list.
:help 'wildignore'
is copied below
'wildignore' 'wig'
'wildignore' 'wig' string (default "")
global
{not in Vi}
{not available when compiled without the +wildignore
feature}
A list of file patterns. A file that matches with one of these
patterns is ignored when expanding wildcards, completing file or
directory names, and influences the result of expand(), glob() and
globpath() unless a flag is passed to disable this.
The pattern is used like with :autocmd, see autocmd-patterns.
Also see 'suffixes'.
Example:
:set wildignore=*.o,*.obj
The use of :set+= and :set-= is preferred when adding or removing
a pattern from the list. This avoids problems when a future version
uses another default.
To find out where it was last set you can use :verbose set wildignore?