untrack
Stops tracking ignored files while leaving them on disk.
Usage
git-wrangler untrack [--repo <path>] [--yes] [--guided]
What it does
Discovers Git worktrees under the current directory, or targets exactly one worktree with --repo. For repositories with a .gitignore, it uses Git’s standard ignored-file rules to find tracked ignored files, removes those files from the Git index with git rm --cached, leaves the files on disk, and commits the removals.
Options
| Flag | Required | Description |
|---|---|---|
--repo <path> | Optional | Target exactly one repository instead of discovering recursively. |
--yes | Optional | Skip the interactive confirmation prompt. |
--guided | Optional | Interactively configure command options before execution. |
This is typically needed after you add ignore rules, including after git-wrangler fix-gitignore, but the ignored files are already tracked.
Example
git-wrangler untrack --yes
Notes
- Files are not deleted from disk; they are only removed from the Git index
- The untracking is committed with the message
"Stop tracking files defined in .gitignore"after confirmation - Repositories without a
.gitignoreare skipped - Repositories where no tracked files match
.gitignoreare skipped cleanly