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

Re: Status shows untracked directory without any untracked file in it

From
Johannes Sixt <j6t@kdbg.org>
Date
Apr 6, 2012, 18:58 UTC
Message-ID
<4F7F3CBB.8030805@kdbg.org>
In-Reply-To
<CAGAhT3n3hHV+UhT+D1o60OAS23WFmx+Lxg=aqYMGC=U-LR1QUA@mail.gmail.com>
Am 06.04.2012 07:19, schrieb Alexander Kostikov:
> How that is possible? Is it a bug?

I don't think so. git status normally does not look inside directories that do not contain any tracked files.

Show 8 quoted lines
> alexko@ALEXKO-LAB b:\
> » git status --untracked-files=normal
> # On branch master
> # Untracked files:
> #   (use "git add<file>..." to include in what will be committed)
> #
> #       data/fex/lba/hi/qna/
> nothing added to commit but untracked files present (use "git add" to track)

Here, git status only knows that it does not track anything inside .../qna/, and it tells you that it found this directory.

> alexko@ALEXKO-LAB b:\
> » git status --untracked-files=all
> # On branch master
> nothing to commit (working directory clean)

Here, you ask to list files in all directories, but, alas, the directory does not contain anything untracked. The directory itself is not listed, because git would be unable to track an empty directory.

-- Hannes
Previous: Jeff KingNext: Jeff King
Message 3 of 5 in “Status shows untracked directory without any untracked file in it”
  1. Alexander KostikovApr 6, 2012
  2. Jeff KingApr 6, 2012
  3. Johannes SixtApr 6, 2012
  4. Jeff KingApr 6, 2012
  5. Jeff KingApr 6, 2012

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.