# Listing untracked files with git status

When a new directory is added to a git repository, only the directory itself will be listed as an untracked file in the output from `git status`:

```bash
$ git status --porcelain
 M commit_notes.sh
?? notes/rust/
```

Use the `--untracked-files` (`-u`) flag to list individual untracked files within the directory:

```bash
$ git status --porcelain -u
 M commit_notes.sh
?? notes/rust/match-operator.md
?? notes/rust/unwrapping.md
```

Source: `man git-status`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.eliasnorrby.com/git/status-untracked-files.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
