> For the complete documentation index, see [llms.txt](https://wikinote.gitbook.io/git-learning/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wikinote.gitbook.io/git-learning/git-ji-chu/files-state.md).

# 文件状态

* **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
  ```
