tracked file
A file Git already knows about because it is in the last commit or the staging area; any other file is untracked.
In more detail
Git reports changes to tracked files and lists untracked ones separately. Ignore rules apply only to untracked files, so adding an already tracked file to .gitignore does nothing; you have to untrack it with git rm --cached and commit that.
Example
git status --short --untracked-files=allRelated terms
- staging area — Git's list of exactly what the next commit will contain, kept in the file .git/index; also called the index.
- .gitignore — A text file of patterns naming untracked files Git should not report or add, such as build output and logs.
- git rm — The command that removes a file from the staging area, and from disk unless you add --cached, so the next commit stops tracking it.
Taught in
- A Repository Is A Folder With A Memory — Advanced Git Internals & Distributed Workflows
- The Three Areas: Working Tree, Index, Repository — Advanced Git Internals & Distributed Workflows
- Committing, And What A Good Message Says — Advanced Git Internals & Distributed Workflows
- Conventional Commits — Advanced Git Internals & Distributed Workflows
- Ignoring Files, And The Tracked File Trap — Advanced Git Internals & Distributed Workflows