# 文件状态

* **Untracked: 未跟踪文件**

  > 定义：没有被git跟踪的文件，通常是新添加的文件，上一个commit不存在的文件

  git status 显示内容

  缩写：?? (红色)

  ```bash
  Untracked files:
  (use "git add <file>..." to include in what will be committed)

      new.js
  ```

  git status -s 显示内容

  ```bash
  ??  new.js
  ```
* ***Unstage*****: 修改未在暂存区**

  > 定义：所有的更改未提交到暂存区的文件集合（未使用 git add 命令）

  缩写：`M` `D` (红色，右面)

  ```bash
  Changes not staged for commit:
    (use "git add <file>..." to update what will be committed)
    (use "git checkout -- <file>..." to discard changes in working directory)

          modified:   new.js
          modified:   README.md
  ```

  git status -s 显示内容

  ```bash
   M new.js
   D edit.js
  ```
* **Stage: 修改已在暂存区状态**

  > 定义：所有的更改已提交暂存区且准备提交到库的文件集合：更改包括以下动作

  缩写：`M` `A` `D` `R` (绿色，左面)

  ```bash
  Untracked files:
  (use "git add <file>..." to include in what will be committed)

      new.js
  ```

  git status -s 显示内容

  ```bash
  M  new.js
  D  edit.js
  ```


---

# 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://wikinote.gitbook.io/git-learning/git-ji-chu/files-state.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.
