Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nrwl/nx/llms.txt
Use this file to discover all available pages before exploring further.
nx affected determines which projects are affected by recent changes in your repository—both projects with modified files and any projects that depend on them—and runs the specified target only for those projects.
How affected works
Nx compares two git refs (--base and --head) to find which files have changed. It then walks the project dependency graph to identify every project that could be impacted by those file changes.
--base— the earlier commit to compare from (commonlyorigin/mainor a merge-base SHA)--head— the later commit to compare to (defaults toHEAD)
Options
Target selection
One or more targets to run for affected projects. Alias:
--target, -t. Accepts comma-separated values.The named configuration to use when running the target. Alias:
-c.Determining affected projects
Base git ref to compare from (e.g., a branch name, tag, or commit SHA). Represents the earlier point in history.
Later git ref to compare to. Defaults to
HEAD. Requires --base to be set.Treat a specific list of files (comma or space separated) as changed, instead of deriving them from git. Conflicts with
--uncommitted, --untracked, --base, and --head.Include uncommitted (staged and unstaged) file changes. Conflicts with
--files, --untracked, --base, and --head.Include untracked files. Conflicts with
--files, --uncommitted, --base, and --head.Read changed file paths from stdin (one per line). Useful for piping output from
git diff. Conflicts with --uncommitted, --untracked, --base, and --head.Filtering and scoping
Comma-separated list of projects to exclude from the run, even if they are affected.
Execution
Maximum number of parallel task processes. Defaults to
3. Set to false to run serially.Controls how task output is displayed. Choices:
tui, dynamic, dynamic-legacy, static, stream, stream-without-prefixes.Stop after the first failed task.
Ignore cycles in the task graph.
Rerun tasks even when results are available in the cache.
Disable the remote cache for this run.
Skip running dependent tasks first.
Skip running sync generators associated with the tasks.
Run tasks in batches for executors that support batch execution.
Show the task graph instead of running it. Pass a file path to save to a file, or
stdout to print to the terminal.The tasks runner to use, as configured in
nx.json.Enable or disable the Nx Terminal UI. Conflicts with
--output-style.Print additional information about the command.
