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

Also available as: JSON · Markdown · 中文
92%Fix Rate
85%Confidence
1Evidence
2023-01-15First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
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-commit

Workarounds

  1. 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.
  2. 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.

中文步骤

  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.

Dead Ends

Common approaches that don't work:

  1. 70% fail

    Running 'git commit -a' will only stage modified tracked files, not untracked ones.

  2. 90% fail

    Using 'git commit -m "message"' without staging will still fail.

  3. 40% fail

    Deleting the untracked files manually may cause data loss if they are needed.