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

FlagRequiredDescription
--repo <path>OptionalTarget exactly one repository instead of discovering recursively.
--yesOptionalSkip the interactive confirmation prompt.
--guidedOptionalInteractively 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 .gitignore are skipped
  • Repositories where no tracked files match .gitignore are skipped cleanly