git
user_error
ai_generated
true
nothing added to commit but untracked files present (use "git add" to track)
ID: git/no-commit-until-add
92%Fix Rate
85%Confidence
1Evidence
2023-01-15First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| git 2.30.0 | active | — | — | — |
| git 2.40.0 | active | — | — | — |
| git 2.45.0 | active | — | — | — |
Root Cause
User attempted to commit without staging any files; only untracked files exist in the working directory.
generic中文
用户尝试提交但未暂存任何文件;工作目录中仅存在未跟踪的文件。
Official Documentation
https://git-scm.com/docs/git-commitWorkarounds
-
95% success Stage the untracked files with 'git add <file>' or 'git add .' to include all untracked files, then commit.
Stage the untracked files with 'git add <file>' or 'git add .' to include all untracked files, then commit.
-
90% success Use 'git add -A' to stage all changes including new files, then commit.
Use 'git add -A' to stage all changes including new files, then commit.
中文步骤
Stage the untracked files with 'git add <file>' or 'git add .' to include all untracked files, then commit.
Use 'git add -A' to stage all changes including new files, then commit.
Dead Ends
Common approaches that don't work:
-
70% fail
Running 'git commit -a' will only stage modified tracked files, not untracked ones.
-
90% fail
Using 'git commit -m "message"' without staging will still fail.
-
40% fail
Deleting the untracked files manually may cause data loss if they are needed.