# 未添加任何内容到提交，但存在未跟踪的文件（使用 "git add" 进行跟踪）

- **ID:** `git/no-commit-until-add`
- **领域:** git
- **类别:** user_error
- **验证级别:** ai_generated
- **修复率:** 92%

## 根因

用户尝试提交但未暂存任何文件；工作目录中仅存在未跟踪的文件。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| git 2.30.0 | active | — | — |
| git 2.40.0 | active | — | — |
| git 2.45.0 | active | — | — |

## 解决方案

1. ```
   Stage the untracked files with 'git add <file>' or 'git add .' to include all untracked files, then commit.
   ```
2. ```
   Use 'git add -A' to stage all changes including new files, then commit.
   ```

## 无效尝试

- **** — Running 'git commit -a' will only stage modified tracked files, not untracked ones. (70% 失败率)
- **** — Using 'git commit -m "message"' without staging will still fail. (90% 失败率)
- **** — Deleting the untracked files manually may cause data loss if they are needed. (40% 失败率)
