git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Behavior of git ls-files

From
Steffen Jaeckel <steffen.jaeckel@stzedn.de>
Date
Mar 4, 2011, 17:38 UTC
Message-ID
<691824945.20110304183831@stzedn.de>
Hi,

I want to list all files in a repository that are tracked, but shall be ignored when following the patterns in .gitignore I tried to do this by "git ls-files --exclude-standard -i" but it seems as if it doesn't properly handle directory entries in .gitignore

The following example shall reproduce this issue:
Show 9 quoted lines
> $ mkdir test
> $ cd test
> $ git init
> $ mkdir testdir
> $ touch testdir/test
> $ git add testdir/test
> $ git commit -m "add test"
> $ echo "testdir/" > .gitignore
> $ git ls-files --exclude-standard -i
Is the behavior of git ls-files correct or not?

Thanks, Steffen

Next: Clemens Buchacher
Message 1 of 2 in “Behavior of git ls-files”
  1. Steffen JaeckelMar 4, 2011
  2. Clemens BuchacherMar 5, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.